* [PATCH mptcp-net] mptcp: fix BUILD_BUG_ON on legacy ARM config
@ 2026-07-07 16:48 Matthieu Baerts (NGI0)
2026-07-07 17:51 ` MPTCP CI
0 siblings, 1 reply; 2+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-07-07 16:48 UTC (permalink / raw)
To: MPTCP Linux; +Cc: Frank Ranner, kernel test robot, Matthieu Baerts (NGI0)
The 0-day bot managed to find kernel configs that cause build failures,
e.g. when using the StrongARM SA1100 target (ARMv4).
On such legacy ARM architecture, all structures are apparently aligned
to 32 bits, causing build issue here. Indeed, on such architecture,
'flags' size is not equivalent to sizeof(u16) as expected, but to
sizeof(u32).
Instead, use memset(). It was not used before to ensure a simple clear
operation was used by the compiler. But at the end, it shouldn't matter,
and the compiler should optimise this to the same operation with or
without memset() when -O above 0 is used. So let's switch to memset() to
fix this issue, and reduce this complexity.
Fixes: 5e939544f9d2 ("mptcp: fix uninit-value in mptcp_established_options")
Suggested-by: Frank Ranner <frank.ranner@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202605312026.Srgsz7Tp-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202607031100.upQfRZTM-lkp@intel.com/
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/options.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 0ca60314d667..47d4a1b520d8 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -571,10 +571,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
bool ret = false;
/* Zero `use_ack` and `use_map` flags with one shot. */
- BUILD_BUG_ON(sizeof_field(struct mptcp_ext, flags) != sizeof(u16));
- BUILD_BUG_ON(!IS_ALIGNED(offsetof(struct mptcp_ext, flags),
- sizeof(u16)));
- *(u16 *)&opts->ext_copy.flags = 0;
+ memset(&opts->ext_copy.flags, 0, sizeof(opts->ext_copy.flags));
opts->csum_reqd = READ_ONCE(msk->csum_enabled);
mpext = skb ? mptcp_get_ext(skb) : NULL;
---
base-commit: 44982139bcde9e34b46ddca0f91f3da9226ebf9a
change-id: 20260707-mptcp-opt-fix-config_aeabi-3d62f92ee7d7
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-07 17:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 16:48 [PATCH mptcp-net] mptcp: fix BUILD_BUG_ON on legacy ARM config Matthieu Baerts (NGI0)
2026-07-07 17:51 ` MPTCP CI
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox