libbpf: fix detection of corrupted BPF instructions section
authorAndrii Nakryiko <andriin@fb.com>
Wed, 29 May 2019 17:36:03 +0000 (10:36 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 29 May 2019 23:23:34 +0000 (01:23 +0200)
commit8ca990ce0d402d5aaf05f7a33ff025fcbcbb5f93
tree4a5d05ae4f807e0a9ac4a9ab5599f57e2adac9ff
parent501b125a29f7cd8983960c5f3c80b337b1359cc3
libbpf: fix detection of corrupted BPF instructions section

Ensure that size of a section w/ BPF instruction is exactly a multiple
of BPF instruction size.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c