From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382468; b=xLHMawbE1zOyxc4dGJtVWxH2HIybYldHV0CXQw1dH8z6qmLEpPuF7W69j1LhgIdVcRLZ RGtRckncyvRF9qH2FX00gm6q5PYCDIwYbJiKFo0qIRPSzEWnNNyjAuHHweUQIzXdHZiVF zHh9EV37vpkF1n2uCTGvWjxUFAAE3ydnwCOq+MkbsOl8SBI8U9ku1f6v2r9LEGpN3wF3u q+HXW8RMUvs+a5zjxq5HCVZ+ZHQ3BYui4lzLJAau0PzijRJhcYqNSdMf3reevZpGUdoVt 3ou4hKpCp8vZC7CGvVFhc9uc/eaEIRIbo3hRtY4R/ZtH5tHsKwDLNji58GLIiiQOpUw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382468; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Z7dRjrDxH3Ne7C/x1KV1RBeN3FKsxGu5is4qyQQLH+E=; b=ZSjcOT0SEovm21F3a2fra6+S8P2xuPUZxMvVXReHDDfkmPvjk/gVfVaQ8Lz/830+86Pb Zj6mvdlfKdUh6pY8P1Ne+RducXjl3KrJLaXfaUjCfQ2Bj2BT5vo3XNq3wzr+EZpuVRp66 uWe3/2sN+ALvKXw2ap8+edFYScppEESUkz96ly3pDQ2BsIuQPlQQkq31QENfyVPFafJUt XlTboIBzf83gxbjUkg9pNP6McAuypo6NSCJkhjB1H4YuI+9WNedVzEz5nYddC9mgdnTE7 wuvOZux5QQSaA+eQstCpZWqSDb6Z9f1iafOMDt7aTwyzriaCgHU7tRfJuYPt3ejUmPQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=cr3mB56x; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CF38606A338; Fri, 4 Dec 2026 11:07:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=cr3mB56x Received: by smtp.kernel.org (Postfix) with ESMTPSA id 968ED1F00935; Fri, 4 Dec 2026 11:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382468; bh=Z7dRjrDxH3Ne7C/x1KV1RBeN3FKsxGu5is4qyQQLH+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cr3mB56xznMnN4OTE7rMWNKMll0vre/a2xFQz+n5txqzEEQ5LaUTmRxS51lzaGpHN TYyOaNUJCK3Kh9wEa1MtLQ/AT6JMwjBQZsoou7HY8wuUADQsiBsKL2Vhn3BbZpowWe bqAS4+TVtxgJohX7nS6g7P1aBgFs6/GcamNW+QBM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nathan Chancellor , "Matthieu Baerts (NGI0)" , Jakub Kicinski Subject: [PATCH 6.18 468/703] mptcp: Avoid unsequenced accesses to jiffies in mptcp_reset_tout_timer() Date: Fri, 4 Dec 2026 19:06:07 +0900 Message-ID: <20261204100640.229959355@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nathan Chancellor commit 728a2abd15a767f662a44030931ea7b2959b4e88 upstream. 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. Cc: stable@vger.kernel.org Fixes: 76a13b315709 ("mptcp: invoke MP_FAIL response when needed") Closes: https://github.com/ClangBuiltLinux/linux/issues/2193 Link: https://github.com/llvm/llvm-project/commit/955715460eaf9188c241c74750637fc82dfcc423 [1] Signed-off-by: Nathan Chancellor Reviewed-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20261114-mptcp-wunsequenced-v1-1-707a73a6c172@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/mptcp/protocol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2799,7 +2799,8 @@ void mptcp_reset_tout_timer(struct mptcp return; close_timeout = (unsigned long)inet_csk(sk)->icsk_mtup.probe_timestamp - - tcp_jiffies32 + jiffies + mptcp_close_timeout(sk); + tcp_jiffies32; + close_timeout += jiffies + mptcp_close_timeout(sk); /* the close timeout takes precedence on the fail one, and here at least one of * them is active