diff options
author | Jeremy Cline <jcline@redhat.com> | 2018-08-01 00:13:16 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-06 17:23:03 +0300 |
commit | 67f0a2887bcb587d4116d5896aaea8432ad04696 (patch) | |
tree | 75c3a9f367b095d698c27040618dfd44b7dcbf6b /drivers | |
parent | ab9a0f80bce707fa4f8b4d63ad1f3b2a89079caa (diff) | |
download | linux-67f0a2887bcb587d4116d5896aaea8432ad04696.tar.xz |
netlink: Fix spectre v1 gadget in netlink_create()
[ Upstream commit bc5b6c0b62b932626a135f516a41838c510c6eba ]
'protocol' is a user-controlled value, so sanitize it after the bounds
check to avoid using it for speculative out-of-bounds access to arrays
indexed by it.
This addresses the following accesses detected with the help of smatch:
* net/netlink/af_netlink.c:654 __netlink_create() warn: potential
spectre issue 'nlk_cb_mutex_keys' [w]
* net/netlink/af_netlink.c:654 __netlink_create() warn: potential
spectre issue 'nlk_cb_mutex_key_strings' [w]
* net/netlink/af_netlink.c:685 netlink_create() warn: potential spectre
issue 'nl_table' [w] (local cap)
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jeremy Cline <jcline@redhat.com>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions