]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: tls_sw, init TLS ULP removes BPF proto hooks
authorJohn Fastabend <john.fastabend@gmail.com>
Thu, 20 Dec 2018 19:35:36 +0000 (11:35 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 20 Dec 2018 22:47:09 +0000 (23:47 +0100)
commit88106e4661c1d44f6e3566e6da9b72f239d6f70e
treecd64f2bdd6ac693f204b18938c5836df2bcc698e
parent1da82407df463df094072732d2c40ad8b3ce4fda
bpf: tls_sw, init TLS ULP removes BPF proto hooks

The existing code did not expect users would initialize the TLS ULP
without subsequently calling the TLS TX enabling socket option.
If the application tries to send data after the TLS ULP enable op
but before the TLS TX enable op the BPF sk_msg verdict program is
skipped. This patch resolves this by converting the ipv4 sock ops
to be calculated at init time the same way ipv6 ops are done. This
pulls in any changes to the sock ops structure that have been made
after the socket was created including the changes from adding the
socket to a sock{map|hash}.

This was discovered by running OpenSSL master branch which calls
the TLS ULP setsockopt early in TLS handshake but only enables
the TLS TX path once the handshake has completed. As a result the
datapath missed the initial handshake messages.

Fixes: 17930e1687ba ("bpf: sockmap, support for msg_peek in sk_msg with redirect ingress")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/tls/tls_main.c