]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
tls: fix replacing proto_ops
authorJakub Kicinski <kuba@kernel.org>
Wed, 24 Nov 2021 23:25:56 +0000 (15:25 -0800)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:49:02 +0000 (09:49 +0100)
commit00e5a19b871ef9243a436a9c759ffb717f55f939
tree546a3b5ecc91b0783d983cc9b79a4cac2139016e
parent367b93116a8d5053129b827efb6425925cbbd4c9
tls: fix replacing proto_ops

BugLink: https://bugs.launchpad.net/bugs/1953370
[ Upstream commit f3911f73f51d1534f4db70b516cc1fcb6be05bae ]

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: c46234ebb4d1 ("tls: RX path for ktls")
Fixes: d4ffb02dee2f ("net/tls: enable sk_msg redirect to tls socket egress")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
net/tls/tls_main.c