Re: [PATCH bpf] bpf: btf: Use exact btf value_size match in map_check_btf()

2018-07-26 Thread Daniel Borkmann
On 07/26/2018 06:57 PM, Martin KaFai Lau wrote: > The current map_check_btf() in BPF_MAP_TYPE_ARRAY rejects > '> map->value_size' to ensure map_seq_show_elem() will not > access things beyond an array element. > > Yonghong suggested that using '!=' is a more correct > check. The 8 bytes round_up

[PATCH bpf] bpf: btf: Use exact btf value_size match in map_check_btf()

2018-07-26 Thread Martin KaFai Lau
The current map_check_btf() in BPF_MAP_TYPE_ARRAY rejects '> map->value_size' to ensure map_seq_show_elem() will not access things beyond an array element. Yonghong suggested that using '!=' is a more correct check. The 8 bytes round_up on value_size is stored in array->elem_size. Hence, using '