]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bpf: Enable unaligned accesses for syscall ctx
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Mon, 6 Apr 2026 19:43:56 +0000 (21:43 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 6 Apr 2026 22:27:26 +0000 (15:27 -0700)
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 <emil@etsalapatis.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20260406194403.1649608-3-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/syscall.c

index 810991709da77d03ea50fdc80aaa1ecded5d0a31..f1044ab9b03be33195c52a7dc76a5ce3de7da22a 100644 (file)
@@ -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;
 }