public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: ipv4: fix alignment fault in sysctl_fib_multipath_hash_seed on ARM64 with Clang
@ 2026-04-15  5:13 Juno Choii
  2026-04-15  5:43 ` Eric Dumazet
  0 siblings, 1 reply; 2+ messages in thread
From: Juno Choii @ 2026-04-15  5:13 UTC (permalink / raw)
  To: netdev; +Cc: davem, edumazet, kuba, pabeni, horms, linux-kernel, Juno Choi

From: Juno Choi <juno.choi@lge.com>

On ARM64, Clang may generate ldaxr (64-bit exclusive load) for
READ_ONCE() on 8-byte structs. ldaxr requires 8-byte natural
alignment, but sysctl_fib_multipath_hash_seed (two u32 members)
only has 4-byte natural alignment.

When this struct lands at a 4-byte-aligned but not 8-byte-aligned
offset within struct netns_ipv4, the ldaxr triggers an alignment
fault in rt6_multipath_hash(), causing a kernel panic in the IPv6
packet receive path (rtl8168_poll -> ipv6_list_rcv ->
rt6_multipath_hash).

Add __aligned(8) to the struct definition when building for ARM64
with Clang to ensure proper alignment for atomic 8-byte loads.

Signed-off-by: Juno Choi <juno.choi@lge.com>
---
 include/net/netns/ipv4.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 276f622f3516..4366ab26512d 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -41,11 +41,18 @@ struct inet_timewait_death_row {
 struct tcp_fastopen_context;
 
 #ifdef CONFIG_IP_ROUTE_MULTIPATH
+#if defined(CONFIG_ARM64) && defined(CONFIG_CC_IS_CLANG)
+struct sysctl_fib_multipath_hash_seed {
+	u32 user_seed;
+	u32 mp_seed;
+} __aligned(8);
+#else
 struct sysctl_fib_multipath_hash_seed {
 	u32 user_seed;
 	u32 mp_seed;
 };
 #endif
+#endif
 
 struct netns_ipv4 {
 	/* Cacheline organization can be found documented in
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-15  5:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-15  5:13 [PATCH] net: ipv4: fix alignment fault in sysctl_fib_multipath_hash_seed on ARM64 with Clang Juno Choii
2026-04-15  5:43 ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox