All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] udp: preserve the connected status if only UDP cmsg" failed to apply to 4.19-stable tree
@ 2024-04-29 12:00 gregkh
  2024-04-30  8:09 ` [PATCH 4.19.y] udp: preserve the connected status if only UDP cmsg Yick Xie
  0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2024-04-29 12:00 UTC (permalink / raw
  To: yick.xie, kuba, willemb; +Cc: stable


The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x 680d11f6e5427b6af1321932286722d24a8b16c1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2024042925-enrich-charbroil-ce36@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..

Possible dependencies:

680d11f6e542 ("udp: preserve the connected status if only UDP cmsg")
5298953e742d ("udp6: don't make extra copies of iflow")
42dcfd850e51 ("udp6: allow SO_MARK ctrl msg to affect routing")
3df98d79215a ("lsm,selinux: pass flowi_common instead of flowi to the LSM hooks")
e94ee171349d ("xfrm: Use correct address family in xfrm_state_find")
5eff06902394 ("ipv4: fill fl4_icmp_{type,code} in ping_v4_sendmsg")
6abde0b24122 ("crypto/chtls: IPv6 support for inline TLS")
ed52f2c608c9 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 680d11f6e5427b6af1321932286722d24a8b16c1 Mon Sep 17 00:00:00 2001
From: Yick Xie <yick.xie@gmail.com>
Date: Fri, 19 Apr 2024 01:06:10 +0800
Subject: [PATCH] udp: preserve the connected status if only UDP cmsg

If "udp_cmsg_send()" returned 0 (i.e. only UDP cmsg),
"connected" should not be set to 0. Otherwise it stops
the connected socket from using the cached route.

Fixes: 2e8de8576343 ("udp: add gso segment cmsg")
Signed-off-by: Yick Xie <yick.xie@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20240418170610.867084-1-yick.xie@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index c02bf011d4a6..420905be5f30 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1123,16 +1123,17 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 
 	if (msg->msg_controllen) {
 		err = udp_cmsg_send(sk, msg, &ipc.gso_size);
-		if (err > 0)
+		if (err > 0) {
 			err = ip_cmsg_send(sk, msg, &ipc,
 					   sk->sk_family == AF_INET6);
+			connected = 0;
+		}
 		if (unlikely(err < 0)) {
 			kfree(ipc.opt);
 			return err;
 		}
 		if (ipc.opt)
 			free = 1;
-		connected = 0;
 	}
 	if (!ipc.opt) {
 		struct ip_options_rcu *inet_opt;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 8b1dd7f51249..1a4cccdd40c9 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1474,9 +1474,11 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 		ipc6.opt = opt;
 
 		err = udp_cmsg_send(sk, msg, &ipc6.gso_size);
-		if (err > 0)
+		if (err > 0) {
 			err = ip6_datagram_send_ctl(sock_net(sk), sk, msg, fl6,
 						    &ipc6);
+			connected = false;
+		}
 		if (err < 0) {
 			fl6_sock_release(flowlabel);
 			return err;
@@ -1488,7 +1490,6 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 		}
 		if (!(opt->opt_nflen|opt->opt_flen))
 			opt = NULL;
-		connected = false;
 	}
 	if (!opt) {
 		opt = txopt_get(np);


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4.19.y] udp: preserve the connected status if only UDP cmsg
  2024-04-29 12:00 FAILED: patch "[PATCH] udp: preserve the connected status if only UDP cmsg" failed to apply to 4.19-stable tree gregkh
@ 2024-04-30  8:09 ` Yick Xie
  2024-04-30  8:22   ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Yick Xie @ 2024-04-30  8:09 UTC (permalink / raw
  To: stable; +Cc: Willem de Bruijn, Jakub Kicinski

If "udp_cmsg_send()" returned 0 (i.e. only UDP cmsg),
"connected" should not be set to 0. Otherwise it stops
the connected socket from using the cached route.

Fixes: 2e8de8576343 ("udp: add gso segment cmsg")
Signed-off-by: Yick Xie <yick.xie@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20240418170610.867084-1-yick.xie@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 680d11f6e5427b6af1321932286722d24a8b16c1)
Signed-off-by: Yick Xie <yick.xie@gmail.com>
---
 net/ipv4/udp.c | 5 +++--
 net/ipv6/udp.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 6e4b26c6f97c..abac13470405 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1001,16 +1001,17 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 
 	if (msg->msg_controllen) {
 		err = udp_cmsg_send(sk, msg, &ipc.gso_size);
-		if (err > 0)
+		if (err > 0) {
 			err = ip_cmsg_send(sk, msg, &ipc,
 					   sk->sk_family == AF_INET6);
+			connected = 0;
+		}
 		if (unlikely(err < 0)) {
 			kfree(ipc.opt);
 			return err;
 		}
 		if (ipc.opt)
 			free = 1;
-		connected = 0;
 	}
 	if (!ipc.opt) {
 		struct ip_options_rcu *inet_opt;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index cf0bbe2e3a79..dd56242a3edf 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1324,9 +1324,11 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 		ipc6.opt = opt;
 
 		err = udp_cmsg_send(sk, msg, &ipc6.gso_size);
-		if (err > 0)
+		if (err > 0) {
 			err = ip6_datagram_send_ctl(sock_net(sk), sk, msg, &fl6,
 						    &ipc6);
+			connected = false;
+		}
 		if (err < 0) {
 			fl6_sock_release(flowlabel);
 			return err;
@@ -1338,7 +1340,6 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 		}
 		if (!(opt->opt_nflen|opt->opt_flen))
 			opt = NULL;
-		connected = false;
 	}
 	if (!opt) {
 		opt = txopt_get(np);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 4.19.y] udp: preserve the connected status if only UDP cmsg
  2024-04-30  8:09 ` [PATCH 4.19.y] udp: preserve the connected status if only UDP cmsg Yick Xie
@ 2024-04-30  8:22   ` Greg KH
  2024-04-30  8:45     ` Yick Xie
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2024-04-30  8:22 UTC (permalink / raw
  To: Yick Xie; +Cc: stable, Willem de Bruijn, Jakub Kicinski

On Tue, Apr 30, 2024 at 04:09:23PM +0800, Yick Xie wrote:
> If "udp_cmsg_send()" returned 0 (i.e. only UDP cmsg),
> "connected" should not be set to 0. Otherwise it stops
> the connected socket from using the cached route.
> 
> Fixes: 2e8de8576343 ("udp: add gso segment cmsg")
> Signed-off-by: Yick Xie <yick.xie@gmail.com>
> Cc: stable@vger.kernel.org
> Reviewed-by: Willem de Bruijn <willemb@google.com>
> Link: https://lore.kernel.org/r/20240418170610.867084-1-yick.xie@gmail.com
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> (cherry picked from commit 680d11f6e5427b6af1321932286722d24a8b16c1)
> Signed-off-by: Yick Xie <yick.xie@gmail.com>
> ---
>  net/ipv4/udp.c | 5 +++--
>  net/ipv6/udp.c | 5 +++--
>  2 files changed, 6 insertions(+), 4 deletions(-)

Sorry, but we can not take a 4.19.y only patch, without it also being
present in newer stable kernels.  If you provide versions for 5.4.y,
5.10.y, and 5.15.y then we can take this one.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4.19.y] udp: preserve the connected status if only UDP cmsg
  2024-04-30  8:22   ` Greg KH
@ 2024-04-30  8:45     ` Yick Xie
  2024-04-30  8:51       ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Yick Xie @ 2024-04-30  8:45 UTC (permalink / raw
  To: Greg KH; +Cc: stable, Willem de Bruijn, Jakub Kicinski

All of them have been sent out.

Thanks

On Tue, Apr 30, 2024 at 4:22 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Apr 30, 2024 at 04:09:23PM +0800, Yick Xie wrote:
> > If "udp_cmsg_send()" returned 0 (i.e. only UDP cmsg),
> > "connected" should not be set to 0. Otherwise it stops
> > the connected socket from using the cached route.
> >
> > Fixes: 2e8de8576343 ("udp: add gso segment cmsg")
> > Signed-off-by: Yick Xie <yick.xie@gmail.com>
> > Cc: stable@vger.kernel.org
> > Reviewed-by: Willem de Bruijn <willemb@google.com>
> > Link: https://lore.kernel.org/r/20240418170610.867084-1-yick.xie@gmail.com
> > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> > (cherry picked from commit 680d11f6e5427b6af1321932286722d24a8b16c1)
> > Signed-off-by: Yick Xie <yick.xie@gmail.com>
> > ---
> >  net/ipv4/udp.c | 5 +++--
> >  net/ipv6/udp.c | 5 +++--
> >  2 files changed, 6 insertions(+), 4 deletions(-)
>
> Sorry, but we can not take a 4.19.y only patch, without it also being
> present in newer stable kernels.  If you provide versions for 5.4.y,
> 5.10.y, and 5.15.y then we can take this one.
>
> thanks,
>
> greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4.19.y] udp: preserve the connected status if only UDP cmsg
  2024-04-30  8:45     ` Yick Xie
@ 2024-04-30  8:51       ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2024-04-30  8:51 UTC (permalink / raw
  To: Yick Xie; +Cc: stable, Willem de Bruijn, Jakub Kicinski

On Tue, Apr 30, 2024 at 04:45:07PM +0800, Yick Xie wrote:
> All of them have been sent out.

All now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-30  8:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29 12:00 FAILED: patch "[PATCH] udp: preserve the connected status if only UDP cmsg" failed to apply to 4.19-stable tree gregkh
2024-04-30  8:09 ` [PATCH 4.19.y] udp: preserve the connected status if only UDP cmsg Yick Xie
2024-04-30  8:22   ` Greg KH
2024-04-30  8:45     ` Yick Xie
2024-04-30  8:51       ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.