mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
bpf: fix uapi bpf_prog_info fields alignment
[ Upstream commit0472301a28
] Merge commit1c8c5a9d38
("Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next") undid the fix from commit36f9814a49
("bpf: fix uapi hole for 32 bit compat applications") by taking the gpl_compatible 1-bit field definition from commitb85fab0e67
("bpf: Add gpl_compatible flag to struct bpf_prog_info") as is. That breaks architectures with 16-bit alignment like m68k. Add 31-bit pad after gpl_compatible to restore alignment of following fields. Thanks to Dmitry V. Levin his analysis of this bug history. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Acked-by: Song Liu <songliubraving@fb.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
af3790a46a
commit
7343178ccf
2 changed files with 2 additions and 0 deletions
|
@ -2486,6 +2486,7 @@ struct bpf_prog_info {
|
|||
char name[BPF_OBJ_NAME_LEN];
|
||||
__u32 ifindex;
|
||||
__u32 gpl_compatible:1;
|
||||
__u32 :31; /* alignment pad */
|
||||
__u64 netns_dev;
|
||||
__u64 netns_ino;
|
||||
__u32 nr_jited_ksyms;
|
||||
|
|
|
@ -2484,6 +2484,7 @@ struct bpf_prog_info {
|
|||
char name[BPF_OBJ_NAME_LEN];
|
||||
__u32 ifindex;
|
||||
__u32 gpl_compatible:1;
|
||||
__u32 :31; /* alignment pad */
|
||||
__u64 netns_dev;
|
||||
__u64 netns_ino;
|
||||
__u32 nr_jited_ksyms;
|
||||
|
|
Loading…
Reference in a new issue