Re: [PATCH net-next v2 0/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-28 Thread Przemek Kitszel
On 3/27/24 15:22, Alexander Lobakin wrote: Some structures contain flexible arrays at the end and the counter for them, but the counter has explicit Endianness and thus __counted_by() can't be used directly. To increase test coverage for potential problems without breaking anything, introduce __

Re: [PATCH][next] wifi: wil6210: Annotate struct wmi_set_link_monitor_cmd with __counted_by()

2024-03-28 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for > array indexing) and CONFIG_FORTIFY_SOURCE (

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

2024-03-28 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting > ready to enable it globally. > > Remove unused flexible-array members in multiple structures, and fix > a hundred -Wflex-array-member-not-at-end warnings[1] in > drivers/wireless/ti/ > > Link

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

2024-03-28 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting > ready to enable it globally. > > There is currently an object (`header`), at the beginning of multiple > structures, that contains a flexible structure (`struct mwl8k_cmd_pkt`), > for example:

[PATCH 0/2] wifi: ath: false-positive fortified-memset warnings

2024-03-28 Thread Arnd Bergmann
From: Arnd Bergmann While testing some other patch series I worked on across gcc versions, I found a couple of stringop warnings that only show up with some toolchains but not others. The warnings I both seem to be false positive. I have also not found an explanation why both of these happen in

[PATCH 1/2] [RESEND] wifi: carl9170: re-fix fortified-memset warning

2024-03-28 Thread Arnd Bergmann
From: Arnd Bergmann The carl9170_tx_release() function sometimes triggers a fortified-memset warning in my randconfig builds: In file included from include/linux/string.h:254, from drivers/net/wireless/ath/carl9170/tx.c:40: In function 'fortify_memset_chk', inlined from 'car

[PATCH 2/2] wifi: ath9k: work around memset overflow warning

2024-03-28 Thread Arnd Bergmann
From: Arnd Bergmann gcc-9 and some other older versions produce a false-positive warning for zeroing two fields In file included from include/linux/string.h:369, from drivers/net/wireless/ath/ath9k/main.c:18: In function 'fortify_memset_chk', inlined from 'ath9k_ps_wakeup' a

Re: [PATCH 1/3] dt-bindings: leds: Add Silergy SY7802 flash LED

2024-03-28 Thread Rob Herring
On Wed, Mar 27, 2024 at 11:51:33PM +0100, André Apitzsch wrote: > Document Silergy SY7802 flash LED driver devicetree bindings. > > Signed-off-by: André Apitzsch > --- > .../devicetree/bindings/leds/silergy,sy7802.yaml | 96 > ++ > 1 file changed, 96 insertions(+) > > dif

Re: [PATCH][next] wifi: wil6210: Annotate struct wmi_set_link_monitor_cmd with __counted_by()

2024-03-28 Thread Gustavo A. R. Silva
On 3/28/24 06:57, Kalle Valo wrote: "Gustavo A. R. Silva" wrote: Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array ind

[PATCH] pstore/blk: replace deprecated strncpy with strscpy

2024-03-28 Thread Justin Stitt
{ - strncpy(info->device, blkdev, 80); + strscpy(info->device, blkdev); info->max_reason = max_reason; info->kmsg_size = check_size(kmsg_size, 4096); info->pmsg_size = check_size(pmsg_size, 4096); --- base-commit: 928a87efa42302a23bb9554be081a28058495f

Re: [PATCH 2/2] wifi: ath9k: work around memset overflow warning

2024-03-28 Thread Toke Høiland-Jørgensen
Arnd Bergmann writes: > From: Arnd Bergmann > > gcc-9 and some other older versions produce a false-positive warning > for zeroing two fields > > In file included from include/linux/string.h:369, > from drivers/net/wireless/ath/ath9k/main.c:18: > In function 'fortify_memset_chk'

[PATCH] reiserfs: replace deprecated strncpy with scnprintf

2024-03-28 Thread Justin Stitt
uot;%d: %-15s%-15d%-15d%-15lld%-15lld(%s)\n", i, namebuf, --- base-commit: 928a87efa42302a23bb9554be081a28058495f22 change-id: 20240328-strncpy-fs-reiserfs-item_ops-c-c2f9b8a6c1f3 Best regards, -- Justin Stitt

[PATCH] smb: client: replace deprecated strncpy with strscpy

2024-03-28 Thread Justin Stitt
*server) } spin_unlock(&server->srv_lock); if (!is_binding && !server->session_estab) { - strncpy(shdr->Signature, "BSRSPYL", 8); + strscpy(shdr->Signature, "BSRSPYL"); return 0; } --- base-commit: 928a87efa42302a23bb9554be081a28058495f22 change-id: 20240328-strncpy-fs-smb-client-cifssmb-c-952d43af06d8 Best regards, -- Justin Stitt

[PATCH v3][next] net/smc: Avoid -Wflex-array-member-not-at-end warnings

2024-03-28 Thread Gustavo A. R. Silva
-Wflex-array-member-not-at-end is coming in GCC-14, and we are getting ready to enable it globally. There are currently a couple of objects in `struct smc_clc_msg_proposal_area` that contain a couple of flexible structures: struct smc_clc_msg_proposal_area { ... struct smc_clc_v2_

Re: [PATCH 2/2] wifi: ath9k: work around memset overflow warning

2024-03-28 Thread Kees Cook
On Thu, Mar 28, 2024 at 02:55:05PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > gcc-9 and some other older versions produce a false-positive warning > for zeroing two fields > > In file included from include/linux/string.h:369, > from drivers/net/wireless/ath/ath9k/main

Re: [PATCH 1/2] [RESEND] wifi: carl9170: re-fix fortified-memset warning

2024-03-28 Thread Kees Cook
On Thu, Mar 28, 2024 at 02:55:04PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > The carl9170_tx_release() function sometimes triggers a fortified-memset > warning in my randconfig builds: > > In file included from include/linux/string.h:254, > from drivers/net/wireless/

[PATCH v4][next] net/smc: Avoid -Wflex-array-member-not-at-end warnings

2024-03-28 Thread Gustavo A. R. Silva
-Wflex-array-member-not-at-end is coming in GCC-14, and we are getting ready to enable it globally. There are currently a couple of objects in `struct smc_clc_msg_proposal_area` that contain a couple of flexible structures: struct smc_clc_msg_proposal_area { ... struct smc_clc_v2_

[PATCH] Squashfs: replace deprecated strncpy with strscpy

2024-03-28 Thread Justin Stitt
(sb, index, &index_start, --- base-commit: 928a87efa42302a23bb9554be081a28058495f22 change-id: 20240328-strncpy-fs-squashfs-namei-c-9d01b8975e53 Best regards, -- Justin Stitt

Re: [PATCH] gcc-plugins/stackleak: Avoid .head.text section

2024-03-28 Thread Kees Cook
On Thu, 28 Mar 2024 07:42:57 +0100, Ard Biesheuvel wrote: > The .head.text section carries the startup code that runs with the MMU > off or with a translation of memory that deviates from the ordinary one. > So avoid instrumentation with the stackleak plugin, which already avoids > .init.text and .

Re: [PATCH] pstore/blk: replace deprecated strncpy with strscpy

2024-03-28 Thread Kees Cook
On Thu, 28 Mar 2024 20:54:16 +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We know that info-device should be NUL-terminated based on its use with > strle

Re: [PATCH] reiserfs: replace deprecated strncpy with scnprintf

2024-03-28 Thread Kees Cook
On Thu, Mar 28, 2024 at 09:16:52PM +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > Our goal here is to get @namebuf populated with @name's contents but > su

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

2024-03-28 Thread Gustavo A. R. Silva
-Wflex-array-member-not-at-end is coming in GCC-14, and we are getting ready to enable it globally. There is currently an object (`tl`), at the beginning of multiple structures, that contains a flexible structure (`struct nfp_dump_tl`), for example: struct nfp_dumpspec_csr { struct nfp_du

Re: [PATCH net-next v2 0/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-28 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Wed, 27 Mar 2024 15:22:38 +0100 you wrote: > Some structures contain flexible arrays at the end and the counter for > them, but the counter has explicit Endianness and thus __counted_by() > can't be used directly.

Re: [PATCH] smb: client: replace deprecated strncpy with strscpy

2024-03-28 Thread Kees Cook
On Thu, Mar 28, 2024 at 09:44:48PM +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > In cifssmb.c: > Using strncpy with a length argument equal to strlen(src)

Re: [PATCH] Squashfs: replace deprecated strncpy with strscpy

2024-03-28 Thread Kees Cook
; i++) { > err = squashfs_read_metadata(sb, index, &index_start, > > --- > base-commit: 928a87efa42302a23bb9554be081a28058495f22 > change-id: 20240328-strncpy-fs-squashfs-namei-c-9d01b8975e53 > > Best regards, > -- > Justin Stitt > > -- Kees Cook

Re: [PATCH] orangefs: cleanup uses of strncpy

2024-03-28 Thread Kees Cook
On Fri, Mar 22, 2024 at 09:41:18PM +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > There is some care taken to ensure these destination buffers are > NUL-te

Re: [PATCH] hfsplus: refactor copy_name to not use strncpy

2024-03-28 Thread Kees Cook
On Thu, Mar 21, 2024 at 11:46:27PM +, Justin Stitt wrote: > strncpy() is deprecated with NUL-terminated destination strings [1]. > > The copy_name() method does a lot of manual buffer manipulation to > eventually arrive with its desired string. If we don't know the > namespace this attr has or

Re: [PATCH] virt: acrn: replace deprecated strncpy with strscpy

2024-03-28 Thread Kees Cook
On Wed, Mar 20, 2024 at 11:27:09PM +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We can see that client->name should be NUL-terminated based on its usage

Re: [PATCH] fs: ecryptfs: replace deprecated strncpy with strscpy

2024-03-28 Thread Kees Cook
On Thu, Mar 21, 2024 at 12:38:54AM +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. A good alternative is strscpy() as it guarantees > NUL-termination on the dest

Re: [PATCH] ext4: replace deprecated strncpy with alternatives

2024-03-28 Thread Kees Cook
On Thu, Mar 21, 2024 at 01:03:10AM +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > in file.c: > s_last_mounted is marked as __nonstring meaning it does not