Re: [PATCH net v4 0/3] mptcp token hash ordering and token 0 lookups

From: Hang Nan

Date: Mon Nov 16 2026 - 09:58:47 EST


Thanks. The missing information is now in the cover letter of v5, which I
am posting for a different reason as well (a new KUnit case, see below),
so this is not a repost just to answer this mail.

Short version, per patch:

1/3 acquire ordering: theoretical. No syzbot report, no KCSAN splat, no
reproducer. KCSAN cannot observe it (it does not model reordering of
marked accesses), and on x86-64 both variants compile to the same
lock cmpxchg, so there is nothing to observe on that hardware. The
evidence is instruction level: on arm64 the CAS becomes CASA.

2/3 token 0: theoretical, found by static analysis. It now carries a
KUnit case, which is the closest thing to a trigger that exists
without winning the race: the test builds the state a dying or
freshly allocated socket presents to a reader (hashed in bucket 0,
carrying token 0) and asserts that the lookup does not return it.

# Subtest: mptcp-token
ok 1 mptcp_token_test_req_basic
ok 2 mptcp_token_test_msk_basic
ok 3 mptcp_token_test_accept
ok 4 mptcp_token_test_destroyed
ok 5 mptcp_token_test_zero
# mptcp-token: pass:5 fail:0 skip:0 total:5

With the guard reverted, the same kernel reports

# mptcp_token_test_zero: EXPECTATION FAILED at net/mptcp/token_test.c:180
not ok 5 mptcp_token_test_zero
# mptcp-token: pass:4 fail:1 skip:0 total:5

so the case does fail without the fix; it is not a test that passes
either way.

3/3 iterator slot check: theoretical as well, and the consumers are
netlink paths that need privileges in the target network namespace.

Both runs are a defconfig x86-64 kernel with CONFIG_MPTCP=y and
CONFIG_MPTCP_KUNIT_TEST=y, booted under qemu with
kunit.filter_glob=mptcp-token.