* [PATCH v2] arm64: bpf: Fix UBSAN misaligned access in BPF JIT
@ 2026-02-25 9:13 Fuad Tabba
2026-02-25 10:09 ` bot+bpf-ci
0 siblings, 1 reply; 2+ messages in thread
From: Fuad Tabba @ 2026-02-25 9:13 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Puranjay Mohan, Catalin Marinas, Will Deacon, bpf,
linux-arm-kernel, linux-kernel
Cc: Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Xu Kuohai, Jakub Sitnicki, Jean-Philippe Brucker, tabba
struct bpf_plt contains a u64 'target' field, but the struct itself is
often placed at 4-byte aligned offsets in the BPF JIT buffer. This
causes UBSAN to report misaligned-access warnings when dereferencing the
structure.
To pacify UBSAN and signal the compiler about the layout without
over-aligning the entire JIT buffer allocation, mark struct bpf_plt as
__packed.
No functional change intended.
Suggested-by: Will Deacon <will@kernel.org>
Fixes: b2ad54e1533e9 ("bpf, arm64: Build branch-target-identification-enabled BPF trampolines")
Signed-off-by: Fuad Tabba <tabba@google.com>
---
arch/arm64/net/bpf_jit_comp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 356d33c7a4ae..fc8c74c29bd6 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -98,7 +98,7 @@ struct bpf_plt {
u32 insn_ldr; /* load target */
u32 insn_br; /* branch to target */
u64 target; /* target value */
-};
+} __packed;
#define PLT_TARGET_SIZE sizeof_field(struct bpf_plt, target)
#define PLT_TARGET_OFFSET offsetof(struct bpf_plt, target)
--
2.53.0.473.g4a7958ca14-goog
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] arm64: bpf: Fix UBSAN misaligned access in BPF JIT
2026-02-25 9:13 [PATCH v2] arm64: bpf: Fix UBSAN misaligned access in BPF JIT Fuad Tabba
@ 2026-02-25 10:09 ` bot+bpf-ci
0 siblings, 0 replies; 2+ messages in thread
From: bot+bpf-ci @ 2026-02-25 10:09 UTC (permalink / raw)
To: tabba, ast, daniel, andrii, puranjay, catalin.marinas, will, bpf,
linux-arm-kernel, linux-kernel
Cc: martin.lau, eddyz87, song, yonghong.song, john.fastabend,
kpsingh, sdf, haoluo, jolsa, xukuohai, jakub, jpb, tabba, ast,
andrii, daniel, martin.lau, eddyz87, yonghong.song, clm,
ihor.solodrai
[-- Attachment #1: Type: text/plain, Size: 1058 bytes --]
> Fixes: b2ad54e1533e9 ("bpf, arm64: Build branch-target-identification-enabled BPF trampolines")
The subject in this Fixes tag does not match the referenced commit.
Commit b2ad54e1533e has subject:
"bpf, arm64: Implement bpf_arch_text_poke() for arm64"
The v1 of this patch had the correct subject, but it appears the
subject was inadvertently changed when respinning to v2.
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/22390726005
AI-authorship-score: low
AI-authorship-explanation: Natural patch evolution through mailing list review with v1 rejected and v2 adopting reviewer suggestion; minor human error in Fixes tag subject change is typical of manual respins.
issues-found: 1
issue-severity-score: low
issue-severity-explanation: Wrong commit subject in Fixes tag; the SHA is correct so tooling is unaffected, but the human-readable reference is inaccurate.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-25 10:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-25 9:13 [PATCH v2] arm64: bpf: Fix UBSAN misaligned access in BPF JIT Fuad Tabba
2026-02-25 10:09 ` bot+bpf-ci
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®