Right, userspace isn't bound by these rules, but the kernel ends up consuming these structures, so we need to fix them. The [0] -> [] changes (when they are not erroneously being used within other st
The issue here seems to be a collision between "unknown array size" and known sizes: struct bpf_lpm_trie_key { __u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */ __u8 data[0]; /* Arbitrary
Author: "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>
Date: Tue, 28 Jun 2022 15:56:23 +0200
Yep; this is actually why I reverted those changes in rdma (before sending out the patch) when 0-day reported the same problems you pointed out[1]. Also, that's the strategy I'm following right now w
I think we will need to switch off the warning in userspace - this is doable for rdma-core. On the other hand, if the goal is to enable the array size check compiler warning I would suggest focusing
Hi Gustavo, Thanks for your patch! These rules apply to the kernel, but uapi is not considered part of the kernel, so different rules apply. Uapi header files should work with whatever compiler that
Author: "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>
Date: Tue, 28 Jun 2022 02:58:25 +0200
No. I think now we can easily workaround these sorts of problems with something like this: struct flex { any_type any_member; union { type array[0]; __DECLARE_FLEX_ARRAY(type, array_flex); }; }; and
This will break the rdma-core userspace as well, with a similar error: /usr/bin/clang-13 -DVERBS_DEBUG -Dibverbs_EXPORTS -Iinclude -I/usr/include/libnl3 -I/usr/include/drm -g -O2 -fdebug-prefix-map=/
Author: Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx>
Date: Mon, 27 Jun 2022 12:53:43 -0700
Thanks this fixes warning with gcc-12 in iproute2. In function xfrm_algo_parse, inlined from xfrm_state_modify.constprop at xfrm_state.c:573:5: xfrm_state.c:162:32: warning: writing 1 byte into a reg
On 6/27/22 8:04 PM, Gustavo A. R. Silva wrote: There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should
Author: "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>
Date: Mon, 27 Jun 2022 20:04:32 +0200
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use flexible array members[1] for these