]> git.baikalelectronics.ru Git - kernel.git/commit
tls: fix replacing proto_ops
authorJakub Kicinski <kuba@kernel.org>
Wed, 24 Nov 2021 23:25:56 +0000 (15:25 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Nov 2021 03:28:16 +0000 (19:28 -0800)
commitfbc02a59f7bbad56d308bc60ab3995d0ed3c06c1
treec59f414ae221bf597da30044722a5d88bf3fda3e
parent6e2f89c06c7c69c97d49c1da54e18b6a93a74761
tls: fix replacing proto_ops

We replace proto_ops whenever TLS is configured for RX. But our
replacement also overrides sendpage_locked, which will crash
unless TX is also configured. Similarly we plug both of those
in for TLS_HW (NIC crypto offload) even tho TLS_HW has a completely
different implementation for TX.

Last but not least we always plug in something based on inet_stream_ops
even though a few of the callbacks differ for IPv6 (getname, release,
bind).

Use a callback building method similar to what we do for struct proto.

Fixes: 3ff4595c20b5 ("tls: RX path for ktls")
Fixes: 51b57a116270 ("net/tls: enable sk_msg redirect to tls socket egress")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_main.c