]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/ulp: remove SOCK_SUPPORT_ZC from tls sockets
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 26 Oct 2022 23:25:58 +0000 (00:25 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 29 Oct 2022 03:21:25 +0000 (20:21 -0700)
Remove SOCK_SUPPORT_ZC when we're setting ulp as it might not support
msghdr::ubuf_info, e.g. like TLS replacing ->sk_prot with a new set of
handlers.

Cc: <stable@vger.kernel.org> # 6.0
Reported-by: Jakub Kicinski <kuba@kernel.org>
Fixes: cd55d475823c5 ("net: flag sockets supporting msghdr originated zerocopy")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_ulp.c

index 7c27aa629af191d44cd1c278b888846d482f1205..9ae50b1bd8444163acedd6f8df70afbb3583bc4b 100644 (file)
@@ -136,6 +136,9 @@ static int __tcp_set_ulp(struct sock *sk, const struct tcp_ulp_ops *ulp_ops)
        if (icsk->icsk_ulp_ops)
                goto out_err;
 
+       if (sk->sk_socket)
+               clear_bit(SOCK_SUPPORT_ZC, &sk->sk_socket->flags);
+
        err = ulp_ops->init(sk);
        if (err)
                goto out_err;