Re: [PATCH bpf] bpf: btf: Fix end boundary calculation for type section

2018-09-12 Thread Daniel Borkmann
On 09/12/2018 07:29 PM, Martin KaFai Lau wrote: > The end boundary math for type section is incorrect in > btf_check_all_metas(). It just happens that hdr->type_off > is always 0 for now because there are only two sections > (type and string) and string section must be at the end (ensured > in btf

Re: [PATCH bpf] bpf: btf: Fix end boundary calculation for type section

2018-09-12 Thread Yonghong Song
On 9/12/18 10:29 AM, Martin KaFai Lau wrote: The end boundary math for type section is incorrect in btf_check_all_metas(). It just happens that hdr->type_off is always 0 for now because there are only two sections (type and string) and string section must be at the end (ensured in btf_parse_s

[PATCH bpf] bpf: btf: Fix end boundary calculation for type section

2018-09-12 Thread Martin KaFai Lau
The end boundary math for type section is incorrect in btf_check_all_metas(). It just happens that hdr->type_off is always 0 for now because there are only two sections (type and string) and string section must be at the end (ensured in btf_parse_str_sec). However, type_off may not be 0 if a new