arm64: bpf: Fix UBSAN misaligned access in BPF JIT
Subsystems (3)
PATCH v2 1/1 arm64: bpf: Fix UBSAN misaligned access in BPF JIT
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.
--- arch/arm64/net/bpf_jit_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/net/bpf_jit_comp.c +1 -1
@@ -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)
Signature · 1 line
2.53.0.473.g4a7958ca14-goog
[email protected]
AI reviewThe subject in this Fixes tag does not match the referenced commit. Commit b2ad54e1533e has subject:
Quoted 1 line
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.