]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: btf: Ensure the member->offset is in the right order
authorMartin KaFai Lau <kafai@fb.com>
Sat, 21 Jul 2018 00:38:37 +0000 (17:38 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 23 Jul 2018 23:20:44 +0000 (01:20 +0200)
commit7b802952656b34252ab9745eee97c0a3282034eb
tree5c196acf3b4827da8059920bc97148106e8739d9
parent05cc9a37f6dd0e27b8dce1ecb171a543ef71ed8b
bpf: btf: Ensure the member->offset is in the right order

This patch ensures the member->offset of a struct
is in the correct order (i.e the later member's offset cannot
go backward).

The current "pahole -J" BTF encoder does not generate something
like this.  However, checking this can ensure future encoder
will not violate this.

Fixes: af3cbd4c20fa ("bpf: btf: Introduce BPF Type Format (BTF)")
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/btf.c
tools/testing/selftests/bpf/test_btf.c