Skip to content

Commit

Permalink
net/ulp: remove SOCK_SUPPORT_ZC from tls sockets
Browse files Browse the repository at this point in the history
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: <[email protected]> # 6.0
Reported-by: Jakub Kicinski <[email protected]>
Fixes: e993ffe ("net: flag sockets supporting msghdr originated zerocopy")
Signed-off-by: Pavel Begunkov <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
isilence authored and kuba-moo committed Oct 29, 2022
1 parent fee9ac0 commit e276d62
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv4/tcp_ulp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e276d62

Please sign in to comment.