Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Wentao Guan
Thu, 19 Nov 2026 04:11
[PATCH net] inet: reject unhashed sockets during timewait purge
Author: Wentao Guan
Date: Thu, 19 Nov 2026 04:11
Date: Thu, 19 Nov 2026 04:11
35 lines
10903 bytes
10903 bytes
A shared ehash can retain a stale pointer that is recycled as an
unhashed SYN-cookie request from another dead namespace. The namespace
recheck alone accepts that request, and
inet_csk_reqsk_queue_drop_and_put() can then operate on an uninitialized
timer.
This is the inet_twsk_purge() counterpart of the validation added for
established lookups. Recheck the nulls node after taking the reference.
If it is unhashed, drop the reference and restart the purge instead of
operating on the recycled request.
Fixes: 4e2b3ef19e0e ("inet: reject unhashed sockets during established lookups")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
---
net/ipv4/inet_timewait_sock.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index e256c55ce9f29..5601bd03b1382 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -333,7 +333,8 @@ void inet_twsk_purge(struct inet_hashinfo *hashinfo)
if (unlikely(!refcount_inc_not_zero_acquire(&sk->sk_refcnt)))
continue;
- if (check_net(sock_net(sk))) {
+ if (unlikely(hlist_nulls_unhashed_lockless(&sk->sk_nulls_node) ||
+ check_net(sock_net(sk)))) {
sock_gen_put(sk);
goto restart;
}
--
2.47.3
Re: [PATCH net] inet: reject unhashed sockets during timewait purge
Author: netdev-bot+sinfo
Date: Thu, 19 Nov 2026 04:17
Date: Thu, 19 Nov 2026 04:17
23 lines
8637 bytes
8637 bytes
Hi! This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information: - How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan. - Whether the issue was actually triggered, or is only theoretical (e.g. found by LLM and not proven at runtime). If it was triggered please include the symptoms, like the stack trace or kernel messages. Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. *IMPORTANT*: If you do repost (for other reasons) - please include the relevant info in the cover letter or commit messages. -- The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads