On Tue, Nov 15, 2022 at 06:34:43PM IST, Dan Carpenter wrote: > Hello Kumar Kartikeya Dwivedi, > > The patch f71b2f64177a: "bpf: Refactor map->off_arr handling" from > Nov 4, 2022, leads to the following Smatch static checker warning: > > kernel/bpf/btf.c:3597 btf_parse_field_offs() > warn: potential pointer math issue ('off' is a 32 bit pointer) > > kernel/bpf/btf.c > 3580 struct btf_field_offs *btf_parse_field_offs(struct btf_record *rec) > 3581 { > 3582 struct btf_field_offs *foffs; > 3583 u32 i, *off; > 3584 u8 *sz; > 3585 > 3586 BUILD_BUG_ON(ARRAY_SIZE(foffs->field_off) != ARRAY_SIZE(foffs->field_sz)); > 3587 if (IS_ERR_OR_NULL(rec) || WARN_ON_ONCE(rec->cnt > sizeof(foffs->field_off))) > ^^^^^^^^^^^^^^^^^^^^^^^^ > s/sizeof/ARRAY_SIZE/ > Thanks for the report, but this one I noticed already and fixed in: 2d577252579b ("bpf: Remove BPF_MAP_OFF_ARR_MAX")