From ea14addf2c3a51e1bd34e395d14e34e370b49384 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 17 Feb 2023 15:25:18 +0100 Subject: [PATCH] 5.15-stable patches added patches: tcp-fix-listen-regression-in-5.15.88.patch --- queue-5.15/series | 1 + ...tcp-fix-listen-regression-in-5.15.88.patch | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 queue-5.15/tcp-fix-listen-regression-in-5.15.88.patch diff --git a/queue-5.15/series b/queue-5.15/series index cf640c74eda..98951e92148 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -39,3 +39,4 @@ platform-x86-amd-pmc-fix-compilation-when-config_debugfs-is-disabled.patch platform-x86-amd-pmc-correct-usage-of-smu-version.patch platform-x86-amd-pmc-disable-irq1-wakeup-for-rn-czn.patch netfilter-nft_tproxy-restrict-to-prerouting-hook.patch +tcp-fix-listen-regression-in-5.15.88.patch diff --git a/queue-5.15/tcp-fix-listen-regression-in-5.15.88.patch b/queue-5.15/tcp-fix-listen-regression-in-5.15.88.patch new file mode 100644 index 00000000000..77a04563974 --- /dev/null +++ b/queue-5.15/tcp-fix-listen-regression-in-5.15.88.patch @@ -0,0 +1,39 @@ +From kuniyu@amazon.com Fri Feb 17 15:21:48 2023 +From: Kuniyuki Iwashima +Date: Mon, 13 Feb 2023 20:45:48 +0000 +Subject: tcp: Fix listen() regression in 5.15.88. +To: +Cc: , , , , , +Message-ID: <20230213205835.56151-1-kuniyu@amazon.com> + +From: Kuniyuki Iwashima + +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 +Signed-off-by: Kuniyuki Iwashima +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -1070,6 +1070,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); -- 2.47.2