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)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Jul 2018 05:43:30 +0000 (22:43 -0700)
commite978de7a6d382ec378830ca2cf38e902df0b6d84
tree2d9f35288b60c467f18e5e81891c0a198a8adad3
parentc8e8cd579bb4265651df8223730105341e61a2d1
net: socket: Fix potential spectre v1 gadget in sock_is_registered

'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>
net/socket.c