Re: [PATCH][next] net/fungible: Avoid -Wflex-array-member-not-at-end warning

2024-08-07 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Mon, 5 Aug 2024 09:30:26 -0600 you wrote: > Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of > a flexible structure where the size of the flexible-array member > is known at compile-time, and refact

Re: [PATCH][next] cxgb4: Avoid -Wflex-array-member-not-at-end warning

2024-08-07 Thread Jakub Kicinski
On Mon, 5 Aug 2024 10:24:30 -0600 Gustavo A. R. Silva wrote: > Subject: [PATCH][next] cxgb4: Avoid -Wflex-array-member-not-at-end warning > Date: Mon, 5 Aug 2024 10:24:30 -0600 > .../chelsio/cxgb4/cxgb4_tc_u32_parse.h| 2 +- > include/uapi/linux/pkt_cls.h | 23 ++

[PATCH] slab: Introduce kmalloc_obj() and family

2024-08-07 Thread Kees Cook
Introduce type-aware kmalloc-family helpers to replace the common idioms for single, array, and flexible object allocations: ptr = kmalloc(sizeof(*ptr), gfp); ptr = kcalloc(count, sizeof(*ptr), gfp); ptr = kmalloc_array(count, sizeof(*ptr), gfp); ptr = kcalloc(count

Re: [PATCH v2] binfmt_flat: Fix corruption when not offsetting data start

2024-08-07 Thread Greg Ungerer
Hi Kees, On 8/8/24 05:51, Kees Cook wrote: Commit 04d82a6d0881 ("binfmt_flat: allow not offsetting data start") introduced a RISC-V specific variant of the FLAT format which does not allocate any space for the (obsolete) array of shared library pointers. However, it did not disable the code whic

Re: [PATCH][next] rpmsg: glink: Avoid -Wflex-array-member-not-at-end warnings

2024-08-07 Thread Gustavo A. R. Silva
@@ -48,7 +51,7 @@ struct glink_msg { struct glink_defer_cmd { struct list_head node; - struct glink_msg msg; + struct glink_msg_hdr msg; u8 data[]; }; Instead of this change (and the container_of() uses below), I think you can just simply drop "data" here. I don'

Re: [PATCH v2] binfmt_flat: Fix corruption when not offsetting data start

2024-08-07 Thread Damien Le Moal
On 2024/08/07 12:51, Kees Cook wrote: > Commit 04d82a6d0881 ("binfmt_flat: allow not offsetting data start") > introduced a RISC-V specific variant of the FLAT format which does > not allocate any space for the (obsolete) array of shared library > pointers. However, it did not disable the code whic

[PATCH v2] binfmt_flat: Fix corruption when not offsetting data start

2024-08-07 Thread Kees Cook
Commit 04d82a6d0881 ("binfmt_flat: allow not offsetting data start") introduced a RISC-V specific variant of the FLAT format which does not allocate any space for the (obsolete) array of shared library pointers. However, it did not disable the code which initializes the array, resulting in the corr

Re: [PATCH][next] cxgb4: Avoid -Wflex-array-member-not-at-end warning

2024-08-07 Thread Simon Horman
On Mon, Aug 05, 2024 at 10:24:30AM -0600, Gustavo A. R. Silva wrote: > -Wflex-array-member-not-at-end was introduced in GCC-14, and we are > getting ready to enable it, globally. > > So, in order to avoid ending up with a flexible-array member in the > middle of multiple other structs, we use the

Re: [PATCH][next] ethtool: Avoid -Wflex-array-member-not-at-end warning

2024-08-07 Thread Simon Horman
On Wed, Aug 07, 2024 at 05:26:02PM +0100, Simon Horman wrote: > On Mon, Aug 05, 2024 at 09:38:08AM -0600, Gustavo A. R. Silva wrote: > > -Wflex-array-member-not-at-end was introduced in GCC-14, and we are > > getting ready to enable it, globally. > > > > Move the conflicting declaration to the end

Re: [PATCH][next] ethtool: Avoid -Wflex-array-member-not-at-end warning

2024-08-07 Thread Simon Horman
On Mon, Aug 05, 2024 at 09:38:08AM -0600, Gustavo A. R. Silva wrote: > -Wflex-array-member-not-at-end was introduced in GCC-14, and we are > getting ready to enable it, globally. > > Move the conflicting declaration to the end of the structure. Notice > that `struct ethtool_dump` is a flexible str

Re: [PATCH][next] sched: act_ct: avoid -Wflex-array-member-not-at-end warning

2024-08-07 Thread Simon Horman
On Mon, Aug 05, 2024 at 09:35:46AM -0600, Gustavo A. R. Silva wrote: > -Wflex-array-member-not-at-end was introduced in GCC-14, and we are > getting ready to enable it, globally. > > Move the conflicting declaration to the end of the structure. Notice > that `struct zones_ht_key` is a flexible str

[PATCH][next] rpmsg: glink: Avoid -Wflex-array-member-not-at-end warnings

2024-08-07 Thread Gustavo A. R. Silva
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. So, in order to avoid ending up with a flexible-array member in the middle of multiple other structs, we use the `__struct_group()` helper to create a new tagged `struct glink_msg_hdr`. This s