Message ID | 20180602032159.21199-1-daniel@iogearbox.net |
---|---|
State | Accepted, archived |
Delegated to: | BPF Maintainers |
Headers | show |
Series | [bpf] bpf: fix uapi hole for 32 bit compat applications | expand |
On Sat, Jun 02, 2018 at 05:21:59AM +0200, Daniel Borkmann wrote: > In 64 bit, we have a 4 byte hole between ifindex and netns_dev in the > case of struct bpf_map_info but also struct bpf_prog_info. In net-next > commit b85fab0e67b ("bpf: Add gpl_compatible flag to struct bpf_prog_info") > added a bitfield into it to expose some flags related to programs. Thus, > add an unnamed __u32 bitfield for both so that alignment keeps the same > in both 32 and 64 bit cases, and can be naturally extended from there > as in b85fab0e67b. > > > Reported-by: Dmitry V. Levin <ldv@altlinux.org> > Reported-by: Eugene Syromiatnikov <esyr@redhat.com> > Fixes: 52775b33bb507 ("bpf: offload: report device information about offloaded maps") > Fixes: 675fc275a3a2d ("bpf: offload: report device information for offloaded programs") > Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> > Acked-by: Alexei Starovoitov <ast@kernel.org> Applied, Thanks.
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index c5ec897..8c31773 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -1017,6 +1017,7 @@ struct bpf_prog_info { __aligned_u64 map_ids; char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; + __u32 :32; __u64 netns_dev; __u64 netns_ino; } __attribute__((aligned(8))); @@ -1030,6 +1031,7 @@ struct bpf_map_info { __u32 map_flags; char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; + __u32 :32; __u64 netns_dev; __u64 netns_ino; } __attribute__((aligned(8))); diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index c5ec897..8c31773 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -1017,6 +1017,7 @@ struct bpf_prog_info { __aligned_u64 map_ids; char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; + __u32 :32; __u64 netns_dev; __u64 netns_ino; } __attribute__((aligned(8))); @@ -1030,6 +1031,7 @@ struct bpf_map_info { __u32 map_flags; char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; + __u32 :32; __u64 netns_dev; __u64 netns_ino; } __attribute__((aligned(8)));