From: Matthieu Baerts <matttbe@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Mat Martineau <martineau@kernel.org>,
Geliang Tang <geliang@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, mptcp@lists.linux.dev,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
stable@vger.kernel.org
Subject: Re: [PATCH net] mptcp: Avoid unsequenced accesses to jiffies in mptcp_reset_tout_timer()
Date: Mon, 16 Nov 2026 15:40:01 +0100 [thread overview]
Message-ID: <1d43222e-b864-44a3-a159-575fc1a9b388@kernel.org> (raw)
In-Reply-To: <20261114-mptcp-wunsequenced-v1-1-707a73a6c172@kernel.org>
Hi Nathan,
On 15/11/2026 05:30, Nathan Chancellor wrote:
> After a recent improvement in clang to warn on unsequenced accesses to
> volatile variables [1], an instance appears in mptcp_reset_tout_timer(),
> which can break the build with CONFIG_WERROR=y / W=e:
>
> net/mptcp/protocol.c:3044:20: error: unsequenced accesses to volatile qualified 'jiffies' [-Werror,-Wunsequenced]
> 3044 | tcp_jiffies32 + jiffies + mptcp_close_timeout(sk);
> | ~~~~~~~~~~~~~ ^
>
> Per C11 5.1.2.3.2, accessing a volatile object is a side effect. Per C11
> 6.5.2, unsequenced side effects on the same scalar object are undefined
> behavior. Per C11 6.5.3, unless otherwise specified, side effects and
> value computations of subexpressions are unsequenced within expressions.
>
> Add an explicit sequence point by splitting the addition expression in
> half, eliminating the undefined behavior and clearing up the warning.
Thank you for the fix, it looks good to me:
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
@Net maintainers: this can be applied in net directly (simple, safe, and
avoid build break with -Werror on newer version of clang).
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
prev parent reply other threads:[~2026-11-16 14:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 4:30 Nathan Chancellor
2026-11-16 14:40 ` Matthieu Baerts [this message]
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=1d43222e-b864-44a3-a159-575fc1a9b388@kernel.org \
--to=matttbe@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=geliang@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=martineau@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
/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®