]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: take into account that bpf_exec_tx_verdict() may free the record
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 27 Nov 2019 20:16:39 +0000 (12:16 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Nov 2019 06:40:29 +0000 (22:40 -0800)
commit2014101b5f24e39011d6d3e3f7e061bb48a7a31c
treea4f623037c5505b26a1a70e01786352308b6a5cd
parent18b87a1665f2345304cb8507e1b5b71fdafe5a26
net/tls: take into account that bpf_exec_tx_verdict() may free the record

bpf_exec_tx_verdict() may free the record if tls_push_record()
fails, or if the entire record got consumed by BPF. Re-check
ctx->open_rec before touching the data.

Fixes: 635a8c9b3da8 ("tls: add bpf support to sk_msg handling")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c