https://github.com/torvalds/linux
Revision fd2c83b35752f0a8236b976978ad4658df14a59f authored by Alexander Potapenko on 25 April 2017, 16:51:46 UTC, committed by David S. Miller on 25 April 2017, 18:05:52 UTC
In the case getsockopt() is called with PACKET_HDRLEN and optlen < 4
|val| remains uninitialized and the syscall may behave differently
depending on its value, and even copy garbage to userspace on certain
architectures. To fix this we now return -EINVAL if optlen is too small.

This bug has been detected with KMSAN.

Signed-off-by: Alexander Potapenko <glider@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8048ced
History
Tip revision: fd2c83b35752f0a8236b976978ad4658df14a59f authored by Alexander Potapenko on 25 April 2017, 16:51:46 UTC
net/packet: check length in getsockopt() called with PACKET_HDRLEN
Tip revision: fd2c83b
File Mode Size
Documentation
arch
block
certs
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.cocciconfig -rw-r--r-- 59 bytes
.get_maintainer.ignore -rw-r--r-- 31 bytes
.gitattributes -rw-r--r-- 30 bytes
.gitignore -rw-r--r-- 1.3 KB
.mailmap -rw-r--r-- 7.9 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 96.0 KB
Kbuild -rw-r--r-- 2.8 KB
Kconfig -rw-r--r-- 252 bytes
MAINTAINERS -rw-r--r-- 389.8 KB
Makefile -rw-r--r-- 57.8 KB
README -rw-r--r-- 722 bytes

README

back to top