Commit 4441c142 authored by Kuniyuki Iwashima's avatar Kuniyuki Iwashima Committed by Jialin Zhang
Browse files

tcp: Fix listen() regression in 5.15.88.

stable inclusion
from stable-v5.15.95
commit fdaf88531cfd17b2a710cceb3141ef6f9085ff40
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I6H3MB
CVE: CVE-2023-0461

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fdaf88531cfd17b2a710cceb3141ef6f9085ff40

---------------------------

When we backport dadd0dcaa67d ("net/ulp: prevent ULP without clone op from
entering the LISTEN status"), we have accidentally backported a part of
7a7160ed ("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: default avatarWinter <winter@winter.cafe>
Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Reviewed-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parent 307d9a04
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment