]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: socket: Fix potential spectre v1 gadget in sock_is_registered
authorJeremy Cline <jcline@redhat.com>
Fri, 27 Jul 2018 22:43:02 +0000 (22:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Aug 2018 14:18:20 +0000 (16:18 +0200)
commit82d0d07a25ebdfebaa2aa3fe713ea6311f5b8669
tree5c2ea7d9189c62f41353d8495dabd4c5bdf14d72
parentbaaa0eb84e9a6ffba110a9c9d49c216a9fc66bb1
net: socket: Fix potential spectre v1 gadget in sock_is_registered

commit e978de7a6d382ec378830ca2cf38e902df0b6d84 upstream.

'family' can be a user-controlled value, so sanitize it after the bounds
check to avoid speculative out-of-bounds access.

Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jeremy Cline <jcline@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/socket.c