Re: [PATCH v2][next] wifi: iwlwifi: mvm: Use __counted_by() and avoid -Wfamnae warnings

2024-09-13 Thread Gustavo A. R. Silva
drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Gustavo-A-R-Silva/wifi-iwlwifi-mvm-Use-__counted_by-and-avoid-Wfamnae-warning

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

2024-09-13 Thread Gustavo A. R. Silva
On 13/09/24 10:12, Jรผrgen GroรŸ wrote: On 13.09.24 10:07, Gustavo A. R. Silva wrote: Hi all, Friendly ping: who can take this, please? ๐Ÿ™‚ I can carry it via the Xen tree. Sounds good. :) Thank you! -- Gustavo

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

2024-09-13 Thread Gustavo A. R. Silva
On 13/09/24 10:12, Jรผrgen GroรŸ wrote: On 13.09.24 10:07, Gustavo A. R. Silva wrote: Hi all, Friendly ping: who can take this, please? ๐Ÿ™‚ I can carry it via the Xen tree. Sounds good. :) Thank you! -- Gustavo

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

2024-09-13 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? ๐Ÿ™‚ Thanks -Gustavo On 21/08/24 22:16, Gustavo A. R. Silva 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 refactor the rest

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

2024-09-13 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? ๐Ÿ™‚ Thanks -Gustavo On 07/08/24 17:19, 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

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

2024-09-13 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? ๐Ÿ™‚ Thanks -Gustavo On 21/08/24 22:16, Gustavo A. R. Silva 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 refactor the rest

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

2024-09-13 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? ๐Ÿ™‚ Thanks -- Gustavo On 21/08/24 02:50, Gustavo A. R. Silva 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 refactor the

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

2024-09-13 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? ๐Ÿ™‚ Thanks -- Gustavo On 21/08/24 02:50, Gustavo A. R. Silva 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 refactor the

Re: [PATCH][next] wifi: iwlwifi: fw/mvm: Avoid multiple -Wflex-array-member-not-at-end warnings

2024-09-13 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? ๐Ÿ™‚ Thanks -- Gustavo On 15/08/24 21:54, 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

Re: [PATCH][next] wifi: iwlwifi: dvm: Avoid -Wflex-array-member-not-at-end warnings

2024-09-13 Thread Gustavo A. R. Silva
Hi all, Friendly ping: who can take this, please? :) Thanks -- Gustavo On 15/08/24 21:00, 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

Re: [PATCH -next] mmc: sdhci-cadence: Annotate struct sdhci_cdns_phy_param with __counted_by()

2024-09-04 Thread Gustavo A. R. Silva
[..] - struct sdhci_cdns_phy_param phy_params[]; + struct sdhci_cdns_phy_param phy_params[] __counted_by(count); It seems there is no such `count` member in the structure[1]. Since `counted_by` hasn't been released in GCC yet. Please, make sure to build-test any `counted_by` patch

Re: How to contribute to the linux kernel

2024-09-02 Thread Gustavo A. R. Silva
Hi! One day, I watched a video from Greg: https://youtu.be/LLBrBBImJt4, and I started wondering if maybe I could contribute to the Linux kernel. If you are interested in security, fixing Coverity issues is a great way to contribute to the kernel. Here are some presentations that you might fin

Re: [Intel-wired-lan] [PATCH iwl-next] ice: Consistently use ethtool_puts() to copy strings

2024-09-02 Thread Gustavo A. R. Silva
On 02/09/24 06:46, Simon Horman wrote: ethtool_puts() is the preferred method for copying ethtool strings. And ethtool_puts() is already used to copy ethtool strings in igc_ethtool_get_strings(). With this patch igc_ethtool_get_strings() uses it for all such cases. In general, the compiler ca

Re: [PATCH] NFSD: Annotate struct pnfs_block_deviceaddr with __counted_by()

2024-08-28 Thread Gustavo A. R. Silva
pnfs_block_deviceaddr with a single volume. Signed-off-by: Thorsten Blum Looks good --`nr_volumes` is updated just before accessing `volumes[]`. Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- fs/nfsd/blocklayout.c| 6 ++ fs/nfsd/blocklayoutxdr.h | 2 +- 2 files changed, 3

Re: [PATCH][next] wifi: radiotap: Avoid -Wflex-array-member-not-at-end warnings

2024-08-27 Thread Gustavo A. R. Silva
On 27/08/24 02:22, Johannes Berg wrote: On Tue, 2024-08-06 at 12:08 -0600, Gustavo A. R. Silva wrote: +++ b/include/net/ieee80211_radiotap.h @@ -24,31 +24,36 @@ * struct ieee80211_radiotap_header - base radiotap header */ struct ieee80211_radiotap_header

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

2024-08-27 Thread Gustavo A. R. Silva
On 22/08/24 11:27, Kees Cook wrote: On Wed, Aug 21, 2024 at 02:16:21PM -0600, Gustavo A. R. Silva 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 refactor the rest of the

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

2024-08-27 Thread Gustavo A. R. Silva
On 22/08/24 11:27, Kees Cook wrote: On Wed, Aug 21, 2024 at 02:16:21PM -0600, Gustavo A. R. Silva 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 refactor the rest of the

Re: [PATCH][next] wifi: mwifiex: Replace one-element arrays with flexible-array members

2024-08-21 Thread Gustavo A. R. Silva
On 21/08/24 15:06, Andy Shevchenko wrote: On Wed, Aug 21, 2024 at 02:59:34PM -0600, Gustavo A. R. Silva wrote: On 21/08/24 14:26, Andy Shevchenko wrote: On Thu, Feb 02, 2023 at 07:32:00PM -0600, Gustavo A. R. Silva wrote: One-element arrays are deprecated, and we are replacing them with

[PATCH][next] wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_cmd_802_11_scan_ext()

2024-08-21 Thread Gustavo A. R. Silva
henko Closes: https://lore.kernel.org/linux-hardening/zszngfnewocpd...@black.fi.intel.com/ Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/marvell/mwifiex/fw.h | 2 +- drivers/net/wireless/marvell/mwifiex/scan.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git

Re: [PATCH][next] wifi: mwifiex: Replace one-element arrays with flexible-array members

2024-08-21 Thread Gustavo A. R. Silva
On 21/08/24 14:26, Andy Shevchenko wrote: On Thu, Feb 02, 2023 at 07:32:00PM -0600, Gustavo A. R. Silva wrote: One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in multiple structures

[PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-08-21 Thread Gustavo A. R. Silva
: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a

[PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-08-21 Thread Gustavo A. R. Silva
: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a

[PATCH][next] xen/pci: Avoid -Wflex-array-member-not-at-end warning

2024-08-20 Thread Gustavo A. R. Silva
containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/xen/pci.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index

[PATCH][next] xen/pci: Avoid -Wflex-array-member-not-at-end warning

2024-08-20 Thread Gustavo A. R. Silva
containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/xen/pci.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index

[PATCH][next] nfc: pn533: Avoid -Wflex-array-member-not-at-end warnings

2024-08-19 Thread Gustavo A. R. Silva
end of another structure [-Wflex-array-member-not-at-end] drivers/nfc/pn533/usb.c:275:38: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/nfc/pn533/usb.c | 1 - 1 file

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

2024-08-19 Thread Gustavo A. R. Silva
On 08/08/24 12:51, Kees Cook wrote: On Wed, Aug 07, 2024 at 09:19:07AM -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

Re: [PATCH v2] ksmbd: Replace one-element arrays with flexible-array members

2024-08-16 Thread Gustavo A. R. Silva
-by: Thorsten Blum Looks good. Reviewed-by: Gustavo A. R. Silva Thanks -Gustavo --- Changes in v2: - Take struct size changes into account and do not subtract 2 additional bytes after feedback from Gustavo A. R. Silva - Compare the binaries before and after the conversion and add a note

Re: [PATCH] ksmbd: Replace one-element arrays with flexible-array members

2024-08-16 Thread Gustavo A. R. Silva
On 16/08/24 07:58, Thorsten Blum wrote: Replace the deprecated one-element arrays with flexible-array members in the structs filesystem_attribute_info and filesystem_device_info. Notice that this also affects the size of the involved structs. I encourage you to study some of the patches th

[PATCH][next] wifi: iwlwifi: fw/mvm: Avoid multiple -Wflex-array-member-not-at-end warnings

2024-08-15 Thread Gustavo A. R. Silva
of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- .../net/wireless/intel/iwlwifi/fw/api/tdls.h | 4 +- .../net/wireless/intel/iwlwifi/fw/api/tx.h| 61 ++- .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 8 ++- drivers/net/wireless

[PATCH][next] wifi: iwlwifi: dvm: Avoid -Wflex-array-member-not-at-end warnings

2024-08-15 Thread Gustavo A. R. Silva
/intel/iwlwifi/dvm/commands.h:2426:27: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- .../net/wireless/intel/iwlwifi/dvm/commands.h | 154 +- 1 file changed, 78

[PATCH][next] wifi: mt76: Avoid multiple -Wflex-array-member-not-at-end warnings

2024-08-15 Thread Gustavo A. R. Silva
flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] drivers/net/wireless/mediatek/mt76/mt7915/mcu.h:58:37: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A

[PATCH][next] wifi: iwlegacy: Avoid multiple -Wflex-array-member-not-at-end warnings

2024-08-14 Thread Gustavo A. R. Silva
structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/intel/iwlegacy/3945.c| 2 +- drivers/net/wireless/intel/iwlegacy/3945.h| 6 +- .../net/wireless/intel/iwlegacy/4965-mac.c| 2 +- .../net/wireless/intel/iwlegacy/commands.h

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

2024-08-13 Thread Gustavo A. R. Silva
/cxgb4_tc_u32_parse.h:245:27: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 1/2][next] UAPI: net/sched: Use __struct_group() in flex struct tc_u32_sel

2024-08-13 Thread Gustavo A. R. Silva
layout of the flexible structure. This new tagged struct will be used to fix problematic declarations of middle-flex-arrays in composite structs[1]. [1] https://git.kernel.org/linus/d88cabfd9abc Signed-off-by: Gustavo A. R. Silva --- include/uapi/linux/pkt_cls.h | 23 +-- 1

[PATCH 0/2][next] UAPI: net/sched - cxgb4: Fix -Wflex-array-member-not-at-end warning

2024-08-13 Thread Gustavo A. R. Silva
Small patch series aimed at fixing a -Wflex-array-member-not-at-end warning by creating a new tagged struct within a flexible structure. We then use this new struct type to fix a problematic middle-flex-array declaration in a composite struct. Gustavo A. R. Silva (2): UAPI: net/sched: Use

Re: [PATCH][next] wifi: ath11k: Avoid -Wflex-array-member-not-at-end warnings

2024-08-10 Thread Gustavo A. R. Silva
On 09/08/24 20:21, Jeff Johnson wrote: On 8/9/2024 9:20 AM, 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

[PATCH v2][next] wifi: iwlwifi: mvm: Use __counted_by() and avoid -Wfamnae warnings

2024-08-09 Thread Gustavo A. R. Silva
-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Fix use of keylen variable. .../net/wireless/intel/iwlwifi/fw/api/sta.h | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 126 -- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 2

[PATCH][next] wifi: iwlwifi: mvm: Use __counted_by() and avoid -Wfamnae warnings

2024-08-09 Thread Gustavo A. R. Silva
-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- .../net/wireless/intel/iwlwifi/fw/api/sta.h | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 126 -- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 2 +- include/net/mac80211.h| 2

[PATCH][next] wifi: ath12k: Avoid -Wflex-array-member-not-at-end warnings

2024-08-09 Thread Gustavo A. R. Silva
containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath12k/core.h | 4 +++- drivers/net/wireless/ath/ath12k/dp.h | 12 2 files changed, 3 insertions(+), 13

[PATCH][next] wifi: ath11k: Avoid -Wflex-array-member-not-at-end warnings

2024-08-09 Thread Gustavo A. R. Silva
-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath11k/core.h | 4 +++- drivers/net/wireless/ath/ath11k/dp.h | 23 --- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index

[PATCH v2][next] UAPI: net/sched: Avoid -Wflex-array-member-not-at-end warning

2024-08-09 Thread Gustavo A. R. Silva
potential bugs in the future. So, with these changes, fix the following warning: drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h:245:27: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R

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

2024-08-09 Thread Gustavo A. R. Silva
is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Remove flex array. (Jakub). net/sched/act_ct.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index

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

2024-08-09 Thread Gustavo A. R. Silva
On 08/08/24 20:46, Jakub Kicinski wrote: On Mon, 5 Aug 2024 09:35:46 -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

[PATCH][next] wifi: mwl8k: Use static_assert() to check struct sizes

2024-08-08 Thread Gustavo A. R. Silva
sert()` to ensure that the memory layout for both the flexible structure and the tagged struct is the same after any changes. Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/marvell/mwl8k.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/marvell/mwl8k.c b/d

[PATCH][next] crypto: nx - Use static_assert() to check struct sizes

2024-08-08 Thread Gustavo A. R. Silva
tic_assert()` to ensure that the memory layout for both the flexible structure and the tagged struct is the same after any changes. Signed-off-by: Gustavo A. R. Silva --- drivers/crypto/nx/nx-842.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/nx/nx-842.h b/drivers/crypto/n

[PATCH][next] crypto: nx - Use static_assert() to check struct sizes

2024-08-08 Thread Gustavo A. R. Silva
tic_assert()` to ensure that the memory layout for both the flexible structure and the tagged struct is the same after any changes. Signed-off-by: Gustavo A. R. Silva --- drivers/crypto/nx/nx-842.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/nx/nx-842.h b/drivers/crypto/n

[PATCH][next] nfp: Use static_assert() to check struct sizes

2024-08-08 Thread Gustavo A. R. Silva
to ensure that the memory layout for both the flexible structure and the tagged struct is the same after any changes. Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/net

[PATCH][next] net/smc: Use static_assert() to check struct sizes

2024-08-08 Thread Gustavo A. R. Silva
ded within these tagged structs. So, we use `static_assert()` to ensure that the memory layout for both the flexible structure and the tagged struct is the same after any changes. Signed-off-by: Gustavo A. R. Silva --- net/smc/smc_clc.h | 4 1 file changed, 4 insertions(+) diff --git

[PATCH][next] crypto: qat - Use static_assert() to check struct sizes

2024-08-08 Thread Gustavo A. R. Silva
tic_assert()` to ensure that the memory layout for both the flexible structure and the tagged struct is the same after any changes. Signed-off-by: Gustavo A. R. Silva --- drivers/crypto/intel/qat/qat_common/qat_bl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/intel/qat/

[PATCH][next] integrity: Use static_assert() to check struct sizes

2024-08-08 Thread Gustavo A. R. Silva
ese tagged structs. So, we use `static_assert()` to ensure that the memory layout for both the flexible structure and the tagged struct is the same after any changes. Signed-off-by: Gustavo A. R. Silva --- security/integrity/integrity.h | 4 1 file changed, 4 insertions(+) diff --git

[PATCH][next] smb: smb2pdu.h: Use static_assert() to check struct sizes

2024-08-08 Thread Gustavo A. R. Silva
tic_assert()` to ensure that the memory layout for both the flexible structure and the tagged struct is the same after any changes. Signed-off-by: Gustavo A. R. Silva --- fs/smb/common/smb2pdu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/smb/common/smb2pdu.h b/fs/smb/common/smb2p

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

2024-08-08 Thread Gustavo A. R. Silva
.../chelsio/cxgb4/cxgb4_tc_u32_parse.h| 2 +- include/uapi/linux/pkt_cls.h | 23 +++ Took me a minute to realize you're changing uAPI. Please fix the subject. What would be a preferred subject? -- Gustavo

Re: [PATCH] fs/select: Annotate struct poll_list with __counted_by()

2024-08-08 Thread Gustavo A. R. Silva
On 08/08/24 09:00, Thorsten Blum wrote: Add the __counted_by compiler attribute to the flexible array member entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Signed-off-by: Thorsten Blum Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo

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] rcu: Annotate struct kvfree_rcu_bulk_data with __counted_by()

2024-08-07 Thread Gustavo A. R. Silva
. Signed-off-by: Thorsten Blum Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- kernel/rcu/tree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index e641cc681901..76d8d75dd8b3 100644 --- a/kernel/rcu/tree.c +++ b/kernel

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

2024-08-07 Thread Gustavo A. R. Silva
is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/rpmsg/qcom_glink_native.c | 42 +-- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg

[PATCH][next] wifi: ipw2x00: libipw: Avoid -Wflex-array-member-not-at-end warnings

2024-08-06 Thread Gustavo A. R. Silva
structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/intel/ipw2x00/libipw.h | 46 - 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/drivers/net/wireless/intel/ipw2x00/libipw.h b/drivers/net/wireless/intel/ipw2x00

[PATCH][next] wifi: radiotap: Avoid -Wflex-array-member-not-at-end warnings

2024-08-06 Thread Gustavo A. R. Silva
] drivers/net/wireless/virtual/mac80211_hwsim.c:767:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/wil6210/txrx.c | 2 +- drivers/net/wireless

Re: [EXTERNAL] [PATCH][next] net: atlantic: Aavoid -Wflex-array-member-not-at-end warnings

2024-08-06 Thread Gustavo A. R. Silva
On 06/08/24 03:42, Igor Russkikh wrote: On 8/5/2024 5:32 PM, 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

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

2024-08-05 Thread Gustavo A. R. Silva
/perf_event.h:289:41: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- arch/x86/events/amd/core.c | 4 +++- arch/x86/events/core.c | 4 +++- arch/x86/events/intel/ds.c | 4

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

2024-08-05 Thread Gustavo A. R. Silva
bugs in the future. So, with these changes, fix the following warning: drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h:245:27: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva

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

2024-08-05 Thread Gustavo A. R. Silva
warning: ./drivers/net/ethernet/chelsio/cxgb4/cxgb4.h:1215:29: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 7 --- 1 file

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

2024-08-05 Thread Gustavo A. R. Silva
warning: net/sched/act_ct.c:57:29: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- net/sched/act_ct.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net

[PATCH][next] net: atlantic: Aavoid -Wflex-array-member-not-at-end warnings

2024-08-05 Thread Gustavo A. R. Silva
flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/aquantia/atlantic/aq_hw.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h

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

2024-08-05 Thread Gustavo A. R. Silva
/fun_dev.c:550:43: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/fungible/funcore/fun_dev.c | 17 +++-- 1 file changed, 7 insertions(+), 10

[PATCH][next] ASoC: SOF: sof-audio: Avoid -Wflex-array-member-not-at-end warnings

2024-08-05 Thread Gustavo A. R. Silva
ble array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva --- sound/soc/sof/sof-audio.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h index 49be02234

Re: [PATCH v3] net: core: annotate socks of struct sock_reuseport with __counted_by

2024-08-01 Thread Gustavo A. R. Silva
alloc()'. Signed-off-by: Dmitry Antipov Reviewed-by: Gustavo A. R. Silva Thanks -Gustavo --- v3: one more style nit (Jakub) https://lore.kernel.org/netdev/20240731165029.5f4b4...@kernel.org v2: style (Jakub), title and commit message (Gustavo) adjustments https://lore.kern

Re: [PATCH v3] ext4: Annotate struct ext4_xattr_inode_array with __counted_by()

2024-07-30 Thread Gustavo A. R. Silva
ext4_expand_inode_array() as suggested by Gustavo A. R. Silva - Use struct_size() and struct_size_t() instead of offsetof() - Link to v1: https://lore.kernel.org/linux-kernel/20240729110454.346918-3-thorsten.b...@toblux.com/ Changes in v3: - Use struct_size() instead of struct_size_t() as suggested by Kees Cook

Re: [PATCH] net: core: use __counted_by for trailing VLA of struct sock_reuseport

2024-07-30 Thread Gustavo A. R. Silva
size()' to simplify the math used in 'kzalloc()'. > Signed-off-by: Dmitry Antipov Looks correct. Reviewed-by: Gustavo A. R. Silva --- include/net/sock_reuseport.h | 2 +- net/core/sock_reuseport.c| 7 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/in

Re: [PATCH v2] ext4: Annotate struct ext4_xattr_inode_array with __counted_by()

2024-07-30 Thread Gustavo A. R. Silva
x27;s count data type. Compile-tested only. Signed-off-by: Thorsten Blum --- Changes in v2: - Adjust ext4_expand_inode_array() as suggested by Gustavo A. R. Silva - Use struct_size() and struct_size_t() instead of offsetof() - Link to v1: https://lore.kernel.org/linux-kernel/20240729110454.346

Re: [PATCH] ext4: Annotate struct ext4_xattr_inode_array with __counted_by()

2024-07-29 Thread Gustavo A. R. Silva
On 29/07/24 05:04, Thorsten Blum wrote: Add the __counted_by compiler attribute to the flexible array member inodes to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. This change seems to be incomplete. The relationship between `count` and accesses to `inode

Re: [drivers/gpio] Question about `ljca_gpio_config`: misuse of __counted_by

2024-07-29 Thread Gustavo A. R. Silva
Hi all, On 26/07/24 14:07, Linus Walleij wrote: Hi Haoyu, On Wed, Jul 24, 2024 at 11:12โ€ฏAM Haoyu Li wrote: Dear Linux Developers for GPIO SUBSYSTEM, We are curious about the use of `struct ljca_gpio_packet *packet` in the function `ljca_gpio_config` (https://elixir.bootlin.com/linux/v6.10

Re: [PATCH] dmaengine: ti: omap-dma: Initialize sglen after allocation

2024-07-16 Thread Gustavo A. R. Silva
t;sglen" after allocation. Fixes: b85178611c11 ("dmaengine: ti: omap-dma: Annotate struct omap_desc with __counted_by") Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Peter Ujfalusi Cc: Vinod Koul Cc: dmaeng...@vger.kernel.org --- drive

Re: [PATCH] interconnect: icc-clk: Add missed num_nodes initialization

2024-07-16 Thread Gustavo A. R. Silva
egister() was missed. Set "num_nodes" after allocation. Fixes: dd4904f3b924 ("interconnect: qcom: Annotate struct icc_onecell_data with __counted_by") Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Georgi Djakov Cc: linux...@vger.k

Re: [PATCH] dmaengine: stm32-dma3: Set lli_size after allocation

2024-07-16 Thread Gustavo A. R. Silva
uot; index "0" will not be considered valid during the initialization for loop. Fix this by setting lli_size immediately after allocation (similar to how this is handled in stm32_mdma_alloc_desc() for the node/count relationship). Fixes: f561ec8b2b33 ("dmaengine: Add STM32 DMA

Re: [PATCH] leds: gpio: Set num_leds after allocation

2024-07-16 Thread Gustavo A. R. Silva
s: gpio: Annotate struct gpio_leds_priv with __counted_by") Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Lee Jones Cc: Pavel Machek Cc: linux-l...@vger.kernel.org --- drivers/leds/leds-gpio.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletio

Re: [PATCH] scsi: ipr: Replace 1-element arrays with flexible arrays

2024-07-11 Thread Gustavo A. R. Silva
[1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Brian King Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-s...@vger.kernel.org --- drivers/scsi/ipr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

Re: [PATCH 6/6] scsi: message: fusion: struct _CONFIG_PAGE_IOC_4: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
SPP/linux/issues/79 [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- Cc: Sathya Prakash Cc: Sreekanth Reddy Cc: Suganath Prabu Subramani Cc: "Gustavo A. R. Silva" Cc: mpt-fusionlinux@broadcom.com Cc: linux-s...@vger.kernel.org

Re: [PATCH 5/6] scsi: message: fusion: struct _CONFIG_PAGE_IOC_3: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
_data.pIocPg3->PhysDisk[i].PhysDiskNum, No binary differences are present after this conversion. Link: https://github.com/KSPP/linux/issues/79 [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Sathya Prakash Cc: Sreekanth Reddy Cc: Suganath Prabu Su

Re: [PATCH 4/6] scsi: message: fusion: struct _CONFIG_PAGE_IOC_2: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
a.pIocPg2->RaidVolume[i].VolumeID == id) mptspi.c: for (i=0; i < ioc->raid_data.pIocPg2->NumActiveVolumes; i++) { mptspi.c: if (ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID == id) { No binary differences are present after this conversion. Link: https://github.com/K

Re: [PATCH 3/6] scsi: message: fusion: struct _CONFIG_PAGE_RAID_PHYS_DISK_1: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
buffer->Path[i].PhysDiskID; mptbase.c: phys_disk->Path[i].PhysDiskBus = buffer->Path[i].PhysDiskBus; No binary differences are present after this conversion. Link: https://github.com/KSPP/linux/issues/79 [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks --

Re: [PATCH 2/6] scsi: message: fusion: struct _CONFIG_PAGE_SAS_IO_UNIT_0: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
No binary differences are present after this conversion. Link: https://github.com/KSPP/linux/issues/79 [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- Cc: Sathya Prakash Cc: Sreekanth Reddy Cc: Suganath Prabu Subramani Cc: "Gustavo A. R. Silva&qu

Re: [PATCH 1/6] scsi: message: fusion: struct _RAID_VOL0_SETTINGS: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
hub.com/KSPP/linux/issues/79 [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- Cc: Sathya Prakash Cc: Sreekanth Reddy Cc: Suganath Prabu Subramani Cc: "Gustavo A. R. Silva" Cc: mpt-fusionlinux@broadcom.com Cc: linux-s...@vger.kernel.org

Re: [PATCH] scsi: aacraid: union aac_init: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
(AAC_MAX_HRRQ - 1) * sizeof(struct _rrq), + AAC_MAX_HRRQ * sizeof(struct _rrq), struct_size_t() can be used here? In any case: Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo 0, 0, 0, NULL, NULL, NULL, NULL, N

Re: [PATCH] scsi: aacraid: struct aac_ciss_phys_luns_resp: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
size = sizeof(struct aac_ciss_phys_luns_resp) + - (AAC_MAX_TARGETS - 1) * sizeof(struct _ciss_lun); + AAC_MAX_TARGETS * sizeof(struct _ciss_lun); I think this is a good candidate for struct_size(). In any case: Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo

Re: [PATCH] scsi: megaraid_sas: struct MR_HOST_DEVICE_LIST: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
rst MR_HOST_DEVICE_LIST_ENTRY. Yeah, clearing that fist entry seems odd/buggy. So, this patch is probably even fixing a bug. :) Link: https://github.com/KSPP/linux/issues/79 [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Kashyap Desai Cc: Su

Re: [PATCH] scsi: megaraid_sas: struct MR_LD_VF_MAP: Replace 1-element arrays with flexible arrays

2024-07-11 Thread Gustavo A. R. Silva
: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Kashyap Desai Cc: Sumit Saxena Cc: Shivasharan S Cc: Chandrakanth patil Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: megaraidlinux@broadcom.com Cc: linux-s...@vger.kernel.org --- drivers/scsi/megaraid/megar

Re: [PATCH 4/4] scsi: mpi3mr: struct mpi3_sas_io_unit_page1: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Sathya Prakash Veerichetty Cc: Kashyap Desai Cc: Sumit Saxena Cc: Sreekanth Reddy Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Ranjan Kumar Cc: mpi3mr-linuxdrv@broadcom.com Cc: linux-s...@vger.kern

Re: [PATCH 3/4] scsi: mpi3mr: struct mpi3_sas_io_unit_page0: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Sathya Prakash Veerichetty Cc: Kashyap Desai Cc: Sumit Saxena Cc: Sreekanth Reddy Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Ranjan Kumar Cc: mpi3mr-linuxdrv@broadcom.com Cc: linux-s...@vger.kern

Re: [PATCH 2/4] scsi: mpi3mr: struct mpi3_event_data_pcie_topology_change_list: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Sathya Prakash Veerichetty Cc: Kashyap Desai Cc: Sumit Saxena Cc: Sreekanth Reddy Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: "Gustavo A. R. Silva" Cc: Ranjan Kumar Cc

Re: [PATCH 1/4] scsi: mpi3mr: struct mpi3_event_data_sas_topology_change_list: Replace 1-element array with flexible array

2024-07-11 Thread Gustavo A. R. Silva
-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: Sathya Prakash Veerichetty Cc: Kashyap Desai Cc: Sumit Saxena Cc: Sreekanth Reddy Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: "Gustavo A. R. Silva" Cc: Ranjan Kumar Cc

Re: [PATCH] efi: Replace efi_memory_attributes_table_t 0-sized array with flexible array

2024-07-10 Thread Gustavo A. R. Silva
On 10/07/24 17:32, Gustavo A. R. Silva wrote: On 10/07/24 16:55, Kees Cook wrote: While efi_memory_attributes_table_t::entry isn't used directly as an array, it is used as a base for pointer arithmetic. The type is wrong as it's not technically an array of efi_memory_desc_t

Re: [PATCH] efi: Replace efi_memory_attributes_table_t 0-sized array with flexible array

2024-07-10 Thread Gustavo A. R. Silva
efi_memory_desc_t entry[]; a candidate for future __counted_by(num_entries * desc_size) ? :p Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo } efi_memory_attributes_table_t; typedef struct {

Re: [PATCH] fs/affs: struct affs_head: Replace 1-element array with flexible array

2024-07-10 Thread Gustavo A. R. Silva
s change. Link: https://github.com/KSPP/linux/issues/79 [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: David Sterba Cc: linux-fsde...@vger.kernel.org --- fs/affs/amigaffs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/affs/

Re: [PATCH] fs/affs: struct affs_data_head: Replace 1-element array with flexible array

2024-07-10 Thread Gustavo A. R. Silva
: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: David Sterba Cc: linux-fsde...@vger.kernel.org --- fs/affs/amigaffs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/affs/amigaffs.h b/fs/affs/amigaffs.h index 09dc23a644df..1b973a669d23 100644 --- a/fs/affs/amigaffs.h

Re: [PATCH] fs/affs: struct slink_front: Replace 1-element array with flexible array

2024-07-10 Thread Gustavo A. R. Silva
: Gustavo A. R. Silva Thanks -- Gustavo --- Cc: David Sterba Cc: linux-fsde...@vger.kernel.org --- fs/affs/amigaffs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/affs/amigaffs.h b/fs/affs/amigaffs.h index 81fb396d4dfa..5509fbc98bc0 100644 --- a/fs/affs/amigaffs.h

Re: [PATCH] virt: vbox: struct vmmdev_hgcm_pagelist: Replace 1-element array with flexible array

2024-07-10 Thread Gustavo A. R. Silva
;pages" to a flexible array. No binary differences are present after this conversion. Link: https://github.com/KSPP/linux/issues/79 [1] Signed-off-by: Kees Cook --- Cc: Hans de Goede Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: "Gustavo A. R. Silva" Cc: linux-hardening@vger

Re: [PATCH 2/2] media: venus: hfi_cmds: struct hfi_session_release_buffer_pkt: Add __counted_by annotation

2024-07-10 Thread Gustavo A. R. Silva
ship. Signed-off-by: Kees Cook --- Cc: Stanimir Varbanov Cc: Vikash Garodia Cc: "Bryan O'Donoghue" Cc: Mauro Carvalho Chehab Cc: "Gustavo A. R. Silva" Cc: linux-me...@vger.kernel.org Cc: linux-arm-...@vger.kernel.org Cc: linux-hardening@vger.kernel.org Reviewe

Re: [PATCH 1/2] media: venus: hfi_cmds: struct hfi_session_release_buffer_pkt: Replace 1-element array with flexible array

2024-07-10 Thread Gustavo A. R. Silva
--- Cc: Stanimir Varbanov Cc: Vikash Garodia Cc: "Bryan O'Donoghue" Cc: Mauro Carvalho Chehab Cc: "Gustavo A. R. Silva" Cc: linux-me...@vger.kernel.org Cc: linux-arm-...@vger.kernel.org Cc: linux-hardening@vger.kernel.org Reviewed-by: Gustavo A. R. Silva Thanks -

Re: [PATCH] x86/syscall: Avoid memcpy() for ia32 syscall_get_arguments()

2024-07-09 Thread Gustavo A. R. Silva
On 09/07/24 12:20, Mirsad Todorovac wrote: On 7/9/24 01:44, Gustavo A. R. Silva wrote: On 7/8/24 14:22, Kees Cook wrote: Modern (fortified) memcpy() prefers to avoid writing (or reading) beyond the end of the addressed destination (or source) struct member: In function

  1   2   3   4   5   6   7   8   9   10   >