]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: sanitize VAR to conservative 1-byte INT
authorAndrii Nakryiko <andriin@fb.com>
Fri, 19 Jul 2019 19:46:03 +0000 (12:46 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 19 Jul 2019 19:48:55 +0000 (12:48 -0700)
commitd1241e51cb34cf3a4e8f6dff0d7256417b8a863f
tree13ec1c89e1f4d94b40ac626d2eb2be5513d5eae8
parentf74cc7023dbfd053910877b557e5fc0bd920be6b
libbpf: sanitize VAR to conservative 1-byte INT

If VAR in non-sanitized BTF was size less than 4, converting such VAR
into an INT with size=4 will cause BTF validation failure due to
violationg of STRUCT (into which DATASEC was converted) member size.
Fix by conservatively using size=1.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf.c