]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
net/tls: prevent bad memory access in tls_is_sk_tx_device_offloaded()
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 9 Apr 2019 00:59:50 +0000 (17:59 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 2 Jul 2019 10:07:53 +0000 (12:07 +0200)
commitc9e1c1a899e77cefc5e25f05c812821a20c83c8f
tree538312c688e974ec162fa7cb51f29c8f138bc416
parent9b7326d4d2250c347aedbebab8e402774f61f278
net/tls: prevent bad memory access in tls_is_sk_tx_device_offloaded()

BugLink: https://bugs.launchpad.net/bugs/1830922
[ Upstream commit b4f47f3848eb70986f75d06112af7b48b7f5f462 ]

Unlike '&&' operator, the '&' does not have short-circuit
evaluation semantics.  IOW both sides of the operator always
get evaluated.  Fix the wrong operator in
tls_is_sk_tx_device_offloaded(), which would lead to
out-of-bounds access for for non-full sockets.

Fixes: 4799ac81e52a ("tls: Add rx inline crypto offload")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
include/net/tls.h