]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix uapi bpf_prog_info fields alignment
authorBaruch Siach <baruch@tkos.co.il>
Fri, 28 Jun 2019 04:08:45 +0000 (07:08 +0300)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 28 Jun 2019 23:35:46 +0000 (01:35 +0200)
commit256b729e9ab51ee2d99baae0f974b1fe48a64ed1
tree98eb7f12ed6a1a6918c463da4a84238db5d0224f
parent3c461275a58fadd97a25ae20f8fade43e8309f92
bpf: fix uapi bpf_prog_info fields alignment

Merge commit 7325e47b67d98 ("Merge
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next") undid the
fix from commit b17363895b2 ("bpf: fix uapi hole for 32 bit compat
applications") by taking the gpl_compatible 1-bit field definition from
commit ebc1ba064bd273 ("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>
include/uapi/linux/bpf.h
tools/include/uapi/linux/bpf.h