]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 12:07:33 +0000 (13:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 12:07:33 +0000 (13:07 +0100)
added patches:
tcp-fix-listen-regression-in-5.15.88.patch

queue-5.4/series
queue-5.4/tcp-fix-listen-regression-in-5.15.88.patch [new file with mode: 0644]

index 6f223ace33a142ef0e2b638d001c064eaf0c00ef..ef373a0b8a053614bc6267a0761932be4e0cfac8 100644 (file)
@@ -350,3 +350,4 @@ net-tls-avoid-hanging-tasks-on-the-tx_lock.patch
 x86-resctrl-apply-read_once-write_once-to-task_struct.-rmid-closid.patch
 x86-resctl-fix-scheduler-confusion-with-current.patch
 bluetooth-hci_sock-purge-socket-queues-in-the-destruct-callback.patch
+tcp-fix-listen-regression-in-5.15.88.patch
diff --git a/queue-5.4/tcp-fix-listen-regression-in-5.15.88.patch b/queue-5.4/tcp-fix-listen-regression-in-5.15.88.patch
new file mode 100644 (file)
index 0000000..d93efe2
--- /dev/null
@@ -0,0 +1,38 @@
+From fdaf88531cfd17b2a710cceb3141ef6f9085ff40 Mon Sep 17 00:00:00 2001
+From: Kuniyuki Iwashima <kuniyu@amazon.com>
+Date: Mon, 13 Feb 2023 20:45:48 +0000
+Subject: tcp: Fix listen() regression in 5.4.229.
+
+From: Kuniyuki Iwashima <kuniyu@amazon.com>
+
+commit fdaf88531cfd17b2a710cceb3141ef6f9085ff40 upstream.
+
+When we backport dadd0dcaa67d ("net/ulp: prevent ULP without clone op from
+entering the LISTEN status"), we have accidentally backported a part of
+7a7160edf1bf ("net: Return errno in sk->sk_prot->get_port().") and removed
+err = -EADDRINUSE in inet_csk_listen_start().
+
+Thus, listen() no longer returns -EADDRINUSE even if ->get_port() failed
+as reported in [0].
+
+We set -EADDRINUSE to err just before ->get_port() to fix the regression.
+
+[0]: https://lore.kernel.org/stable/EF8A45D0-768A-4CD5-9A8A-0FA6E610ABF7@winter.cafe/
+
+Reported-by: Winter <winter@winter.cafe>
+Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/inet_connection_sock.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/net/ipv4/inet_connection_sock.c
++++ b/net/ipv4/inet_connection_sock.c
+@@ -932,6 +932,7 @@ int inet_csk_listen_start(struct sock *s
+        * It is OK, because this socket enters to hash table only
+        * after validation is complete.
+        */
++      err = -EADDRINUSE;
+       inet_sk_state_store(sk, TCP_LISTEN);
+       if (!sk->sk_prot->get_port(sk, inet->inet_num)) {
+               inet->inet_sport = htons(inet->inet_num);