Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: enforce correct alignment for instructions

After commit 9facc336876f ("bpf: reject any prog that failed read-only lock")
offsetof(struct bpf_binary_header, image) became 3 instead of 4,
breaking powerpc BPF badly, since instructions need to be word aligned.

Fixes: 9facc336876f ("bpf: reject any prog that failed read-only lock")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
92624782 08d02364

+3 -1
+3 -1
include/linux/filter.h
··· 472 472 struct bpf_binary_header { 473 473 u16 pages; 474 474 u16 locked:1; 475 - u8 image[]; 475 + 476 + /* Some arches need word alignment for their instructions */ 477 + u8 image[] __aligned(4); 476 478 }; 477 479 478 480 struct bpf_prog {