public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jakub Kicinski <[email protected]>,
	"David S . Miller" <[email protected]>,
	[email protected],
	John Fastabend <[email protected]>,
	[email protected]
Subject: [PATCH net 3/4] net/ulp: remove SOCK_SUPPORT_ZC from tls sockets
Date: Thu, 27 Oct 2022 00:25:58 +0100	[thread overview]
Message-ID: <604fa24e63524f9e0f5098df7e1a578debf471bf.1666825799.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

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: e993ffe3da4bc ("net: flag sockets supporting msghdr originated zerocopy")
Signed-off-by: Pavel Begunkov <[email protected]>
---
 net/ipv4/tcp_ulp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv4/tcp_ulp.c b/net/ipv4/tcp_ulp.c
index 7c27aa629af1..9ae50b1bd844 100644
--- a/net/ipv4/tcp_ulp.c
+++ b/net/ipv4/tcp_ulp.c
@@ -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;
-- 
2.38.0


  parent reply	other threads:[~2022-10-26 23:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 23:25 [PATCH net 0/4] a few corrections for SOCK_SUPPORT_ZC Pavel Begunkov
2022-10-26 23:25 ` [PATCH net 1/4] udp: advertise ipv6 udp support for msghdr::ubuf_info Pavel Begunkov
2022-10-26 23:25 ` [PATCH net 2/4] net: remove SOCK_SUPPORT_ZC from sockmap Pavel Begunkov
2022-10-26 23:25 ` Pavel Begunkov [this message]
2022-10-26 23:25 ` [PATCH net 4/4] net: also flag accepted sockets supporting msghdr originated zerocopy Pavel Begunkov
2022-10-29  4:50 ` [PATCH net 0/4] a few corrections for SOCK_SUPPORT_ZC patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=604fa24e63524f9e0f5098df7e1a578debf471bf.1666825799.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox