On Tue, Jun 4, 2019 at 4:40 AM Baruch Siach <baruch@xxxxxxxxxx> wrote: > > Merge commit 1c8c5a9d38f60 ("Merge > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next") undid the > fix from commit 36f9814a494 ("bpf: fix uapi hole for 32 bit compat > applications") by taking the gpl_compatible 1-bit field definition from > commit b85fab0e67b162 ("bpf: Add gpl_compatible flag to struct > bpf_prog_info") as is. That breaks architectures with 16-bit alignment > like m68k. Widen gpl_compatible to 32-bit to restore alignment of the > following fields. The commit log is misleading and incorrect. Since compiler makes it into 16-bit field, it's a compiler bug. u32 in C should stay as u32 regardless of architecture. > Thanks to Dmitry V. Levin his analysis of this bug history. > > Cc: Jiri Olsa <jolsa@xxxxxxxxxx> > Cc: Daniel Borkmann <daniel@xxxxxxxxxxxxx> > Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> > Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> > Signed-off-by: Baruch Siach <baruch@xxxxxxxxxx> > --- > include/uapi/linux/bpf.h | 2 +- > tools/include/uapi/linux/bpf.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h > index 63e0cf66f01a..fe73829b5b1c 100644 > --- a/include/uapi/linux/bpf.h > +++ b/include/uapi/linux/bpf.h > @@ -3140,7 +3140,7 @@ struct bpf_prog_info { > __aligned_u64 map_ids; > char name[BPF_OBJ_NAME_LEN]; > __u32 ifindex; > - __u32 gpl_compatible:1; > + __u32 gpl_compatible; > __u64 netns_dev; No need.