🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
3 messages
3 total messages Started by Wentao Guan Thu, 19 Nov 2026 02:56
[PATCH net] tcp: cancel cloned request timers without waiting
#18911
Author: Wentao Guan
Date: Thu, 19 Nov 2026 02:56
36 lines
10895 bytes
When a cloned request is migrated again, its timer has the same lockdep
class as the running request callback. Using timer_delete_sync() through
__inet_csk_reqsk_queue_drop(..., false) can therefore trigger a
recursive-locking splat and disable lockdep.

The clone is unhashed when inet_ehash_insert() fails, so
reqsk_queue_unlink() is a no-op. Its timer is pinned to the current CPU,
allowing it to be cancelled without waiting for its callback. Use
timer_delete() and drop the timer reference directly instead of
synchronously deleting it through the queue helper.

Fixes: 97c8a3c1f73d ("tcp: Fix potential UAF in reqsk_timer_handler().")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
---
 net/ipv4/inet_connection_sock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 6c079929e06f6..346d0015a140d 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -1121,8 +1121,8 @@ static void reqsk_timer_handler(struct timer_list *t)
 			return;
 
 		if (!inet_ehash_insert(req_to_sk(nreq), req_to_sk(oreq), NULL)) {
-			/* delete timer */
-			__inet_csk_reqsk_queue_drop(sk_listener, nreq, false);
+			if (timer_delete(&nreq->rsk_timer))
+				reqsk_put(nreq);
 			goto no_ownership;
 		}
 
-- 
2.47.3
Re: [PATCH net] tcp: cancel cloned request timers without waiting
#18922
Author: netdev-bot+sinfo
Date: Thu, 19 Nov 2026 03:03
23 lines
8591 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.
Re: [PATCH net] tcp: cancel cloned request timers without waiting
#18993
Author: "关文涛"
Date: Thu, 19 Nov 2026 06:40
22 lines
11907 bytes
Hi,

> On Thu, 19 Nov 2026 10:56:20 +0800, Wentao Guan wrote:
> > When a cloned request is migrated again, its timer has the same lockdep
> > class as the running request callback. Using timer_delete_sync() through
> > __inet_csk_reqsk_queue_drop(..., false) can therefore trigger a
> > recursive-locking splat and disable lockdep.
> 
> This is net-next material.

Thanks for your review, I will modifiy it in v2.

> >
> > The clone is unhashed when inet_ehash_insert() fails, so
> > reqsk_queue_unlink() is a no-op. Its timer is pinned to the current CPU,
> > allowing it to be cancelled without waiting for its callback. Use
> > timer_delete() and drop the timer reference directly instead of
> > synchronously deleting it through the queue helper.
> 
> This change depnds on 4e2b3ef19e0e, without that, __reqsk_free()
> frees reqsk immediately and timer triggers UAF.
> 
> So please mention the commit.
OK, I will add them.

> >
> > Fixes: 97c8a3c1f73d ("tcp: Fix potential UAF in reqsk_timer_handler().")
> > Cc: stable@vger.kernel.org
>
> Please drop two tags above.
OK.

BRs
Wentao Guan
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