]> 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)
commit773e7318439b64ffe71162ff657671528fbb747a
treebb6a3e2bd6a20d7a822094a4998e9c34c897f206
parent231fd614e490d6812224498e4fdd5e5c6c864d85
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: c7e51a9c5c83 ("net/tls: free the record on encryption error")
Fixes: 7f1e5e018bbc ("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