]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: fix encryption error checking
authorVadim Fedorenko <vfedorenko@novek.ru>
Wed, 20 May 2020 08:41:43 +0000 (11:41 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 May 2020 00:20:06 +0000 (17:20 -0700)
commitce708c9495f172707c68028c5c051b3c99b37e5a
treebb6a3e2bd6a20d7a822094a4998e9c34c897f206
parentb96f756285358ebb26a5c840e64d280b93f8b002
net/tls: fix encryption error checking

bpf_exec_tx_verdict() can return negative value for copied
variable. In that case this value will be pushed back to caller
and the real error code will be lost. Fix it using signed type and
checking for positive value.

Fixes: 14210c49b09b ("net/tls: free the record on encryption error")
Fixes: 635a8c9b3da8 ("tls: add bpf support to sk_msg handling")
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c