android_kernel_oneplus_msm8998/net/unix
Mateusz Jurczyk 0fc0fad077 af_unix: Add sockaddr length checks before accessing sa_family in bind and connect handlers
[ Upstream commit defbcf2decc903a28d8398aa477b6881e711e3ea ]

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_UNIX 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.

Signed-off-by: Mateusz Jurczyk <mjurczyk@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-05 14:37:13 +02:00
..
af_unix.c af_unix: Add sockaddr length checks before accessing sa_family in bind and connect handlers 2017-07-05 14:37:13 +02:00
diag.c unix_diag: fix incorrect sign extension in unix_lookup_by_ino 2016-03-03 15:07:07 -08:00
garbage.c net: unix: properly re-increment inflight counter of GC discarded candidates 2017-03-30 09:35:13 +02:00
Kconfig net: Default UDP and UNIX diag to 'n'. 2012-01-07 12:13:06 -08:00
Makefile unix_diag: Write it into kbuild 2011-12-16 13:48:29 -05:00
sysctl_net_unix.c net: Convert uses of typedef ctl_table to struct ctl_table 2013-06-13 02:36:09 -07:00