]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: socket: fix potential spectre v1 gadget in socketcall
authorJeremy Cline <jcline@redhat.com>
Fri, 27 Jul 2018 22:43:01 +0000 (22:43 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 24 Apr 2019 08:09:07 +0000 (10:09 +0200)
commitdb3a93c7e51733485595abcc4d9c2e312a5c068a
treec370a47142773e567348979d1f07412e43268d35
parentf2ddb34ac2deb8f4b64e61f3685fe91e25dfe3d8
net: socket: fix potential spectre v1 gadget in socketcall

'call' is a user-controlled value, so sanitize the array index after the
bounds check to avoid speculating past the bounds of the 'nargs' array.

Found with the help of Smatch:

net/socket.c:2508 __do_sys_socketcall() warn: potential spectre issue
'nargs' [r] (local cap)

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>
CVE-2017-5753

(cherry picked from commit c8e8cd579bb4265651df8223730105341e61a2d1)
Signed-off-by: Juerg Haefliger <juergh@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/socket.c