From: Kumar Kartikeya Dwivedi Date: Mon, 6 Apr 2026 19:43:56 +0000 (+0200) Subject: bpf: Enable unaligned accesses for syscall ctx X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f25777056e24c5e724935b94a9a1aa16641be49a;p=thirdparty%2Fkernel%2Flinux.git bpf: Enable unaligned accesses for syscall ctx Don't reject usage of fixed unaligned offsets for syscall ctx. Tests will be added in later commits. Unaligned offsets already work for variable offsets. Reviewed-by: Emil Tsalapatis Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20260406194403.1649608-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov --- diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 810991709da77..f1044ab9b03be 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -6386,8 +6386,7 @@ static bool syscall_prog_is_valid_access(int off, int size, { if (off < 0 || off >= U16_MAX) return false; - if (off % size != 0) - return false; + /* No alignment requirements for syscall ctx accesses. */ return true; }