Re: [PATCH bpf] libbpf: sanitize VAR to conservative 1-byte INT

2019-07-19 Thread Alexei Starovoitov
On 7/19/19 12:46 PM, Andrii Nakryiko wrote: > 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. > > Si

[PATCH bpf] libbpf: sanitize VAR to conservative 1-byte INT

2019-07-19 Thread Andrii Nakryiko
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 --- tools/lib/bpf/libbpf.