[Devel] [PATCH hci-8.2 0/4] ms/net: backport request migration RCU fixes and lockless refcount ordering
Konstantin Khorenko
khorenko at virtuozzo.com
Mon Nov 23 11:44:12 MSK 2026
I won't apply this version, please send v2 with the changes below.
1. Add 4e2b3ef19e0e0 ("inet: reject unhashed sockets during
established lookups") before 1/4.
2. Add a9782a6f2bbd0 ("tcp: Pass req->rsk_listener to
inet_csk_reqsk_queue_drop() in tcp_check_req().") and 62754aad50d0b
("tcp: fix request_sock use-after-free during Fast Open accept()").
3. Cover letter: patch 4 is not a plain cherry-pick, say that 1/4 is
taken from stable, and list the new patches.
The four patches themselves match mainline hunk for hunk, and the
rebase note of 4/4 is right.
On Mon, 23 Nov 2026 02:20:21 +0200, Eva Kurchatova wrote:
> Mainline fixes for sockets whose data another CPU can still read after
> an ownership transfer, mostly with request migration, or after the TCP
> handshake completes on another CPU.
Item 1: 1/4 is patch 2/2 of the upstream series "inet: fix lockless
ehash walk races", merged together with 4e2b3ef19e0e0 as 7b1fd973214de.
That one is not in hci-8.2: the established lookups take the reference
and recheck the tuple, but never check that the socket is still
hashed. A lookup that loaded the address of a freed socket can return
a SYN cookie request that reused the slab object, unhashed and with a
NULL rsk_listener, and tcp_v4_rcv() then oopses on the listener. Its
changelog has the reproduced crash, it is Cc stable, and it also
replaces the __reqsk_free() calls after the refcount store with
reqsk_put(). It applies cleanly before 1/4.
Item 2: both fix commits that are in this tree, d4f2c86b2b7e and
e3d95ad7da4f, and both are request_sock lifetime fixes of the same
kind. After a migration tcp_check_req() still passes the new listener,
not req->rsk_listener, to inet_csk_reqsk_queue_drop()
(tcp_minisocks.c:907), so the new listener's qlen underflows and it
stops answering SYNs.
> Patches 1, 3 and 4 are plain cherry-picks; patch 2 conflicted only in
> context, and patch 4 has a rebase note for __reqsk_free(), which is
Item 3: the sentence calls patch 4 a plain cherry-pick and gives it a
rebase note at once. 1/4 also carries "[ Upstream commit ]" and Sasha
Levin's Signed-off-by from stable 6f4fc93f76cd8, unlike the others.
Sashiko's remark on 1/4 needs no change: the timer_setup() reorder is
in mainline 5b5d8f351dd96 itself, and it is right, the timer of the
clone must be set up before the release store makes it reachable.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list