mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hang Nan <2122295973@qq.com>
To: netdev-bot+sinfo@kernel.org
Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev,
	matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, kuniyu@google.com,
	willemb@google.com, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, 2122295973@qq.com
Subject: Re: [PATCH net v4 0/3] mptcp token hash ordering and token 0 lookups
Date: Mon, 16 Nov 2026 20:20:25 +0800	[thread overview]
Message-ID: <tencent_5B7B9ECE9036BE72D331CB2A2E4AEC5F8909@qq.com> (raw)
In-Reply-To: <20261115155747.178858-1-2122295973@qq.com>

Thanks for the prompt.  Honest answer up front: none of the three patches
has a runtime trigger.  All three are theoretical, and this is what I
should have put in the commit messages.

1/3 net: mptcp: take token lookup references with acquire ordering
   Theoretical.  There is no syzbot report, no KCSAN splat and no
   reproducer.  KCSAN cannot observe this class of defect at all:
   Documentation/dev-tools/kcsan.rst is explicit that watchpoints are
   only set up for plain accesses ("KCSAN never sets up a watchpoint on
   marked accesses") and that "reordering of marked accesses is not
   modeled", and the reordering in question involves a marked refcount
   operation.  On x86-64 there is nothing to observe anyway: both
   variants compile to the same lock cmpxchg.  The evidence is
   instruction-level: on arm64 the CAS becomes CASA
   (88a37c02 cas -> 88e17c43 casa), which I can attach if wanted.  What
   I did confirm is only reachability of the lookup path from the wire
   (mptcp_parse_option() -> subflow_token_join_request() ->
   mptcp_token_get_sock()), which is a static reading, not a runtime
   demonstration of the reordering.

2/3 net: mptcp: reject token 0 in mptcp_token_get_sock()
   Theoretical, and found by static analysis while addressing a review
   comment on 1/3, not by fuzzing.  The crash path I describe
   (subflow_check_req() -> mptcp_pm_announced_has_ssk() walking
   msk->pm.anno_list before mptcp_pm_data_init() has run) is argued from
   code; I have not triggered it and have no stack trace or KASAN
   report for it.  What is verified is the input side: the token is
   copied from the MP_JOIN option without validation, and 0 is never
   assigned to a live connection, so a lookup for 0 relies entirely on
   the two comparisons that cannot distinguish it.

3/3 net: mptcp: verify the token slot in mptcp_token_iter_next()
   Theoretical as well.  Both consumers (mptcp_diag and the userspace
   path manager) are netlink paths that need privileges in the target
   network namespace, so this is not a remote attack surface in the
   first place.

For 2/3 I will add a KUnit case to net/mptcp/token_test.c
(mptcp_token_get_sock(&init_net, 0) must return NULL) in the next
revision, so at least the guard has a regression test.  I am not
reposting only for this message; if reviewers want the above folded into
the cover letter, I will include it with the next respin.


  parent reply	other threads:[~2026-11-16 12:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20261115155747.178858-1-2122295973@qq.com>
2026-11-15 15:57 ` [PATCH net v4 1/3] net: mptcp: take token lookup references with acquire ordering Hang Nan
2026-11-15 15:57 ` [PATCH net v4 2/3] net: mptcp: reject token 0 in mptcp_token_get_sock() Hang Nan
2026-11-15 15:57 ` [PATCH net v4 3/3] net: mptcp: verify the token slot in mptcp_token_iter_next() Hang Nan
2026-11-16 12:20 ` Hang Nan [this message]
2026-11-15 15:57 [PATCH net v4 0/3] mptcp token hash ordering and token 0 lookups Hang Nan
2026-11-15 20:12 ` netdev-bot+sinfo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_5B7B9ECE9036BE72D331CB2A2E4AEC5F8909@qq.com \
    --to=2122295973@qq.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=geliang@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev-bot+sinfo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®