From: Geliang Tang <geliang@kernel.org>
To: Matthieu Baerts <matttbe@kernel.org>,
MPTCP Linux <mptcp@lists.linux.dev>
Subject: Re: [PATCH next mptcp-net 3/3] mptcp: remove thmac from subflow ctx
Date: Fri, 21 Aug 2026 13:33:15 +0800 [thread overview]
Message-ID: <70fd3506eb1ae37535eb60dfa4726cd5de96a782.camel@kernel.org> (raw)
In-Reply-To: <db4d2939-e543-42f6-b3e2-e044943a8e29@kernel.org>
Hi Matt,
On Wed, 2026-08-19 at 12:02 +0200, Matthieu Baerts wrote:
> Hi Geliang,
>
> On 19/08/2026 11:56, Geliang Tang wrote:
> > Hi Matt,
> >
> > On Tue, 2026-08-18 at 19:55 +0200, Matthieu Baerts (NGI0) wrote:
> > > This entry is only used in subflow_finish_connect().
> > >
> > > Instead, use the original value from mp_opt, and pass it to
> > > subflow_thmac_valid() to do the validation with the given
> > > truncated
> > > hmac.
> > >
> > > While at it, rename the variables in subflow_thmac_valid() to
> > > avoid
> > > confusions about the received one vs the expected one.
> > >
> > > Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> > > ---
> > > net/mptcp/protocol.h | 1 -
> > > net/mptcp/subflow.c | 18 +++++++++---------
> > > 2 files changed, 9 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> > > index 7e168e450fb0..d414065d1966 100644
> > > --- a/net/mptcp/protocol.h
> > > +++ b/net/mptcp/protocol.h
> > > @@ -592,7 +592,6 @@ struct mptcp_subflow_context {
> > > bool fully_established; /* path validated */
> > > u32 lent_mem_frag;
> > > u32 remote_nonce;
> > > - u64 thmac;
> > > u32 local_nonce;
> > > u32 remote_token;
> > > union {
> > > diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
> > > index 01db7edce18a..2d7ccb01d234 100644
> > > --- a/net/mptcp/subflow.c
> > > +++ b/net/mptcp/subflow.c
> > > @@ -408,20 +408,21 @@ static struct dst_entry
> > > *subflow_v6_route_req(const struct sock *sk,
> > > #endif
> > >
> > > /* validate received truncated hmac and create hmac for third
> > > ACK */
> > > -static bool subflow_thmac_valid(struct mptcp_subflow_context
> > > *subflow)
> > > +static bool subflow_thmac_valid(struct mptcp_subflow_context
> > > *subflow,
> > > + u64 thmac)
> >
> > Perhaps we could rename this parameter, say to "subflow_thmac", so
> > that
> > we don't need to rename the local variable "thmac" to
> > "expected_thmac".
> > What do you think?
> I initially did that, but it fell more natural to use the "expected"
> keyword, similar to other places, and in the selftests, than the
> opposite. Also, we pass "thmac" to subflow_thmac_valid(), but seeing
> the
> argument renamed didn't feel right.
>
> If it was for -net, I would have minimised the diff, but here, let's
> get
> thing rights I think, no?
OK, no further comments from my side. I'll add my Reviewed-by tag in
reply to the cover letter.
Thanks,
-Geliang
>
> Cheers,
> Matt
next prev parent reply other threads:[~2026-08-21 5:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 17:55 [PATCH mptcp-net 0/3] mptcp: avoid uninitialised read with MPJ with SYN cookies Matthieu Baerts (NGI0)
2026-08-18 17:55 ` [PATCH mptcp-net 1/3] mptcp: syncookies: remember the request backup flag Matthieu Baerts (NGI0)
2026-08-18 17:55 ` [PATCH mptcp-net 2/3] mptcp: subflow: no need to copy thmac during ulp_clone Matthieu Baerts (NGI0)
2026-08-21 6:03 ` Matthieu Baerts
2026-08-21 6:06 ` Matthieu Baerts
2026-08-18 17:55 ` [PATCH next mptcp-net 3/3] mptcp: remove thmac from subflow ctx Matthieu Baerts (NGI0)
2026-08-19 9:56 ` Geliang Tang
2026-08-19 10:02 ` Matthieu Baerts
2026-08-21 5:33 ` Geliang Tang [this message]
2026-08-18 19:20 ` [PATCH mptcp-net 0/3] mptcp: avoid uninitialised read with MPJ with SYN cookies MPTCP CI
2026-08-21 5:37 ` Geliang Tang
2026-08-21 6:32 ` Matthieu Baerts
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=70fd3506eb1ae37535eb60dfa4726cd5de96a782.camel@kernel.org \
--to=geliang@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
/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