]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Apr 2019 05:42:28 +0000 (22:42 -0700)
commit1b9b37303b058bde23e6ce63d8537cf5b8fc40c4
tree5d92ea30690481c584bb4aa40246f02e592dd50f
parenta5accdf98372f0b5a96cf1e97234c23f29052f3a
net/tls: prevent bad memory access in tls_is_sk_tx_device_offloaded()

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: 512639d24cd0 ("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>
include/net/tls.h