From: Hans Wippel <redacted>
Use proper endianness conversion for an skb protocol assignment. Given
that IUCV is only available on big endian systems (s390), this simply
avoids an endianness warning reported by sparse.
Signed-off-by: Hans Wippel <redacted>
Reviewed-by: Julian Wiedmann <redacted>
Reviewed-by: Ursula Braun <redacted>
Signed-off-by: Julian Wiedmann <redacted>
---
net/iucv/af_iucv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Mateusz Jurczyk <redacted>
Verify that the caller-provided sockaddr structure is large enough to
contain the sa_family field, before accessing it in bind() and connect()
handlers of the AF_IUCV socket. Since neither syscall enforces a minimum
size of the corresponding memory region, very short sockaddrs (zero or
one byte long) result in operating on uninitialized memory while
referencing .sa_family.
Fixes: 52a82e23b9f2 ("af_iucv: Validate socket address length in iucv_sock_bind()")
Signed-off-by: Mateusz Jurczyk <redacted>
[jwi: removed unneeded null-check for addr]
Signed-off-by: Julian Wiedmann <redacted>
---
net/iucv/af_iucv.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
From: Oliver Hartkopp <socketcan@hartkopp.net> Date: 2017-06-23 17:36:17
On 06/23/2017 07:32 PM, Julian Wiedmann wrote:
From: Mateusz Jurczyk <redacted>
Verify that the caller-provided sockaddr structure is large enough to
contain the sa_family field, before accessing it in bind() and connect()
handlers of the AF_IUCV socket. Since neither syscall enforces a minimum
size of the corresponding memory region, very short sockaddrs (zero or
one byte long) result in operating on uninitialized memory while
referencing .sa_family.
Won't it make sense to generally check the minimum length for .sa_family at a
single point before fixing all called sites?
Regards,
Oliver
From: David Miller <davem@davemloft.net> Date: 2017-06-23 18:53:47
From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: Fri, 23 Jun 2017 19:36:12 +0200
On 06/23/2017 07:32 PM, Julian Wiedmann wrote:
quoted
From: Mateusz Jurczyk <redacted>
Verify that the caller-provided sockaddr structure is large enough to
contain the sa_family field, before accessing it in bind() and connect()
handlers of the AF_IUCV socket. Since neither syscall enforces a minimum
size of the corresponding memory region, very short sockaddrs (zero or
one byte long) result in operating on uninitialized memory while
referencing .sa_family.
Won't it make sense to generally check the minimum length for .sa_family at a
single point before fixing all called sites?
We had this discussion last week and we decided that putting it into
the handlers is the way to go for now.
From: Hans Wippel <redacted>
Use proper endianness conversion for an skb protocol assignment. Given
that IUCV is only available on big endian systems (s390), this simply
avoids an endianness warning reported by sparse.
Signed-off-by: Hans Wippel <redacted>
Reviewed-by: Julian Wiedmann <redacted>
Reviewed-by: Ursula Braun <redacted>
Signed-off-by: Julian Wiedmann <redacted>
From: Mateusz Jurczyk <redacted>
Verify that the caller-provided sockaddr structure is large enough to
contain the sa_family field, before accessing it in bind() and connect()
handlers of the AF_IUCV socket. Since neither syscall enforces a minimum
size of the corresponding memory region, very short sockaddrs (zero or
one byte long) result in operating on uninitialized memory while
referencing .sa_family.
Fixes: 52a82e23b9f2 ("af_iucv: Validate socket address length in iucv_sock_bind()")
Signed-off-by: Mateusz Jurczyk <redacted>
[jwi: removed unneeded null-check for addr]
Signed-off-by: Julian Wiedmann <redacted>