From nobody Tue Apr 7 15:27:23 2026 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 446B336657E for ; Thu, 26 Feb 2026 11:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772104688; cv=none; b=fheFXxGgzY1lstLOi/Bqru/9FqAhbg8qQ8wB9sz0FDsqGzAx1Mt1cxP/OgkctYru/yMedV808CIYfdDITDq4SPVKMBygwv6T4DyQqORM+mexcSVnIRaYLsj/C4blV5/+/3hi8aE5FxL6d7CL1dRyfWMEeJXiHhggi8w8JvJqLfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772104688; c=relaxed/simple; bh=Tda3X1h6hjXboAEqtey5KSiQRBdK9Kh2CQJXrLYM4X0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QmG9prcIZ0bPveivE/juqMCeRS+PZIWISkwd3cKrn7COZe1vvlkYgAV9Ut8ZdoIbuEmdfMh4I/uBBDkOV5E40Xa9Knqg6a+l9b0SMbbAh/ZCbwhpEHHtt/pFwINXH4R3wEeP8K0ivIkWX33ztEpOoDQEg2kjOEJNpliJ0czjobQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FQvACxiY; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FQvACxiY" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-824484dba4dso826814b3a.0 for ; Thu, 26 Feb 2026 03:18:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772104683; x=1772709483; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jV7kecYCTzcrsCFjFw3qK5G5qwWc4nsIa+UHPnJX5do=; b=FQvACxiYMZI6OIPAnmHZcBTt3ku9aJujLIk9yLB/cOkVKtFKrRfu56+VfrwALwFFtU dud4h9PAysP3MwbkCuP89IAdcs/7md4j280wYF1KwgQaoNTmabeRwHTRJ/HiJRypiW2l yIGxZKQ2y86Lzn8vhII4ucqwcd3Rg3zxifmOb67NOfEKMG5B6wB/6RQapeyxReCdAbiD UC81/fZyEV0NIIRSq3/oRV9picQcnfZNbX43FD6phGzq4umS3rznexd/KoO6sGi9YJfS JSUQLUV3o1u/oq3ECRaGe+gntjOZIbdr9hEyQU9qn9OIkhCSOQ3ZTFM/SeKSVfPKl79H GgwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772104683; x=1772709483; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jV7kecYCTzcrsCFjFw3qK5G5qwWc4nsIa+UHPnJX5do=; b=Qbsnk30aspjl4gPbU2I20+5XM9l60w0Hbzg2iQLnv1LxSrJYowrZau+KAtrim3Nq34 2qrjbf+jqo6isqMZa//iq1B2+ptvud3NnwlRkwkECk1X4fMdaY7GNP5OhosvjTR6zoka /3G+PShz5UnQ4yWq2YlE1iG1Dwyasi+CPxxtrv/2TWpY0SD4W8f0gFG9XurjtWbXAD9o SvaBYLOomSbuZCRXtDGqGJeRpxfSHKKDXUkJoncA6xbvoN8UJ5JyzhJcCT0gnJPPFhIu XSAjPSMaYz5mESkjZTMHk5P3SFfST7dR1yTe06qXg3mvEcdu8M5IxLMd5W5NPOcQN9UY hr2A== X-Forwarded-Encrypted: i=1; AJvYcCVt0NpH9E/KcwGQSSWJwaxEh0WhYO3U1DHPEMi43IcbnyhstYqWWUkpWNIprz07xd8lUImW3LblsliJKhM=@vger.kernel.org X-Gm-Message-State: AOJu0Yzg565EFEdEBaccu/flHncKiBoyv2nzEtteL/poKyamQjJ/u8t1 Nd+V7lGJM6zqiQocfh3A4ay9AnlL4oftzI4l15CbItOlqahqdAg9SLcM X-Gm-Gg: ATEYQzxxg/Ey8ySRyBCPagiOCjXeUt5xyvoGXyWPjCHMBrc91gwnGM2XPs+Fy2Q56ck pLTLuPtHRzgtDNkM69QAwiI9xu9Y4lg0Y10iZEbE34NZsFlNGxxU2Qf3foKX7f248tooONVqs2Y MsMcRQQNrnU+3MGW4p9C7NNcXjAp8rWTOkOoqaKXIbX1JokDiQ/ttaBlSyNUbWnjUvGuexBYcYx x7+CJTUwkSjez+QrlK/iarhi/pFuhr3tE+9THuUBNozB1JZPImJdXVT7NDRFJBHEv1bWj94nDXc 7NzAZ/YaYYrjgb8pBy1xSMDzDyVfX5uKkwMT/suwTRghV/2TWQGKmKNVZoRyiw8POq1oHqgYFzN GYZeH4/eiKZAKLH0bewBStt/Yt4foCFZAyYP+xYdH750I8hTtn5AVY2ofjHTrCW6/c36iNiLz/y jUSxmLwssV6ThMtsUBhxH6A6vDw5QXJHsOdS0Hm99kD0BTPlEjlXPlYTf17qn33DnekyoLPf7F9 +5olgk3132PecsGLJaHj0+H4FuxsXpdzMVr3CoX5qHwu4dfvTuSVo9EwFR5AwuEXi0KBtnH3X8X 8gRD/wpXJQ== X-Received: by 2002:a05:6a00:3e0b:b0:824:a81e:97b5 with SMTP id d2e1a72fcca58-8273bfa235emr2041811b3a.38.1772104683383; Thu, 26 Feb 2026 03:18:03 -0800 (PST) Received: from yuu-U24E.. (2001-b400-e3d7-38de-fa71-5111-1751-cb7a.emome-ip6.hinet.net. [2001:b400:e3d7:38de:fa71:5111:1751:cb7a]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8273a088517sm2110831b3a.65.2026.02.26.03.17.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 03:18:02 -0800 (PST) From: Yung Chih Su To: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, nathan@kernel.org, nick.desaulniers+lkml@gmail.com, morbo@google.com, justinstitt@google.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Yung Chih Su Subject: [PATCH] net: ipv6: fix ARM64 alignment fault in fib_multipath_hash_from_keys() Date: Thu, 26 Feb 2026 19:17:21 +0800 Message-ID: <20260226111721.25454-1-yuuchihsu@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" struct sysctl_fib_multipath_hash_seed contains two u32 fields (user_seed and mp_seed), making it an 8-byte structure with a 4-byte alignment require= ment. In fib_multipath_hash_from_keys(), the code evaluates the entire struct atomically via READ_ONCE(): mp_seed =3D READ_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed).mp_seed; While this silently works on GCC by falling back to unaligned regular loads (e.g., LDR/LDUR) which the ARM64 kernel tolerates, it causes a fatal kernel panic when compiled with Clang and LTO enabled. Commit e35123d83ee3 ("arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=3Dy") strengthens READ_ONCE() to use Load-Acquire instructions (ldar / ldapr) to prevent compiler reordering bugs under Clang LTO. Since the macro evaluates the full 8-byte struct, Clang emits a 64-bit ldar instruction. ARM64 architecture strictly requires ldar to be naturally aligned. Executing a 64-bit ldar on a 4-byte aligned address (e.g., ending in 0xEC) triggers a strict Alignment Fault (FSC =3D 0x21). Fix this by moving the READ_ONCE() directly to the specific u32 member: mp_seed =3D READ_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed.mp_seed); This instructs the compiler to emit a 32-bit load (ldar Wn or ldr Wn), which perfectly satisfies the 4-byte alignment requirement and resolves the crash. Fixes: [4ee2a8cace3fb9a34aea6a56426f89d26dd514f3] ("net: ipv4: Add a sysctl= to set multipath hash seed") Signed-off-by: Yung Chih Su --- include/net/ip_fib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index b4495c38e0a0..318593743b6e 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -559,7 +559,7 @@ static inline u32 fib_multipath_hash_from_keys(const st= ruct net *net, siphash_aligned_key_t hash_key; u32 mp_seed; =20 - mp_seed =3D READ_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed).mp_seed; + mp_seed =3D READ_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed.mp_seed); fib_multipath_hash_construct_key(&hash_key, mp_seed); =20 return flow_hash_from_keys_seed(keys, &hash_key); --=20 2.43.0