Re: [PATCH] net: dsa: lan9303: replace deprecated strncpy with memcpy

2023-10-04 Thread Kees Cook
On Wed, Oct 04, 2023 at 08:07:55PM -0700, Kees Cook wrote: > On Thu, Oct 05, 2023 at 12:30:18AM +, 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 > > interfaces. > > > > Let's opt

Re: [PATCH] net: atheros: replace deprecated strncpy with strscpy

2023-10-04 Thread Kees Cook
On Thu, Oct 05, 2023 at 01:29:45AM +, 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 expect netdev->name to be NUL-terminated based on its use with format

Re: [PATCH] net: ax88796c: replace deprecated strncpy with strscpy

2023-10-04 Thread Kees Cook
On Thu, Oct 05, 2023 at 01:06:26AM +, 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 suitable replacement is `strscpy` [2] due to the fact that it > guarant

Re: [PATCH] net: ena: replace deprecated strncpy with strscpy

2023-10-04 Thread Kees Cook
On Thu, Oct 05, 2023 at 12:56:08AM +, 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. > > NUL-padding is not necessary as host_info is initialized to > `ena_dev->h

Re: [PATCH] net: dsa: lan9303: replace deprecated strncpy with memcpy

2023-10-04 Thread Kees Cook
On Thu, Oct 05, 2023 at 12:30:18AM +, 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 > interfaces. > > Let's opt for memcpy as we are copying strings into slices of length > `ETH_GSTR

Re: [PATCH] can: peak_pci: replace deprecated strncpy with strscpy

2023-10-04 Thread Kees Cook
On Thu, Oct 05, 2023 at 12:05:35AM +, 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. > > NUL-padding is not required since card is already zero-initialized: > |

[PATCH] MAINTAINERS: Include sof headers under ASoC

2023-10-04 Thread Kees Cook
Add missing sof header files for ASoC. Suggested-by: Mark Brown Link: https://lore.kernel.org/lkml/f258a7e6-0728-4f55-a71a-6e99113ce...@sirena.org.uk Signed-off-by: Kees Cook --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 585a13b9b52a..811

[PATCH] net: atheros: replace deprecated strncpy with strscpy

2023-10-04 Thread Justin Stitt
`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 expect netdev->name to be NUL-terminated based on its use with format strings and dev_info(): | dev_info(&adapter->pdev->dev, |

[PATCH] net: ax88796c: replace deprecated strncpy with strscpy

2023-10-04 Thread Justin Stitt
`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 suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-pa

[PATCH] net: ena: replace deprecated strncpy with strscpy

2023-10-04 Thread Justin Stitt
`strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. NUL-padding is not necessary as host_info is initialized to `ena_dev->host_attr.host_info` which is ultimately zero-initialized via alloc_etherde

[PATCH] net: dsa: lan9303: replace deprecated strncpy with memcpy

2023-10-04 Thread Justin Stitt
`strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous interfaces. Let's opt for memcpy as we are copying strings into slices of length `ETH_GSTRING_LEN` within the `data` buffer. Other similar get_strings() implementat

[PATCH] can: peak_pci: replace deprecated strncpy with strscpy

2023-10-04 Thread Justin Stitt
sizeof(card->led_chip.name)); card->i2c_bit = peak_pciec_i2c_bit_ops; --- base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2 change-id: 20231004-strncpy-drivers-net-can-sja1000-peak_pci-c-9c2e5e32be83 Best regards, -- Justin Stitt

Re: [PATCH 0/5] chelsio: Annotate structs with __counted_by

2023-10-04 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Fri, 29 Sep 2023 11:11:44 -0700 you wrote: > Hi, > > This annotates several chelsio structures with the coming __counted_by > attribute for bounds checking of flexible arrays at run-time. For more > details, > s

Re: [PATCH] MAINTAINERS: Include additional ASoC paths

2023-10-04 Thread Mark Brown
On Wed, Oct 04, 2023 at 12:41:14PM -0700, Kees Cook wrote: > >The SOF header is also missing from the entry for SOF. > Ah, right! Can you take this and tweak it with the missing entries, or should > I send a v2? Could you send an incremental patch please? It's already in my CI as is. signatu

Re: [PATCH] MAINTAINERS: Include additional ASoC paths

2023-10-04 Thread Gustavo A. R. Silva
On 10/4/23 21:34, Kees Cook wrote: Make sure a few other paths are correctly sent to the ASoC maintainers. Link: https://lore.kernel.org/lkml/63dd3676.170a0220.1f1b2.3...@mx.google.com/ Cc: Mark Brown Signed-off-by: Kees Cook Acked-by: Gustavo A. R. Silva Thanks! -- Gustavo --- MAIN

Re: [PATCH] MAINTAINERS: Include additional ASoC paths

2023-10-04 Thread Kees Cook
On October 4, 2023 12:40:00 PM PDT, Mark Brown wrote: >On Wed, Oct 04, 2023 at 12:34:45PM -0700, Kees Cook wrote: > >> +++ b/MAINTAINERS >> @@ -20116,6 +20116,8 @@ F: Documentation/devicetree/bindings/sound/ >> F: Documentation/sound/soc/ >> F: include/dt-bindings/sound/ >> F: include/soun

Re: [PATCH] MAINTAINERS: Include additional ASoC paths

2023-10-04 Thread Mark Brown
On Wed, Oct 04, 2023 at 12:34:45PM -0700, Kees Cook wrote: > +++ b/MAINTAINERS > @@ -20116,6 +20116,8 @@ F:Documentation/devicetree/bindings/sound/ > F: Documentation/sound/soc/ > F: include/dt-bindings/sound/ > F: include/sound/soc* > +F: include/sound/sof/ > +F: include/uapi/sou

[PATCH] MAINTAINERS: Include additional ASoC paths

2023-10-04 Thread Kees Cook
Make sure a few other paths are correctly sent to the ASoC maintainers. Link: https://lore.kernel.org/lkml/63dd3676.170a0220.1f1b2.3...@mx.google.com/ Cc: Mark Brown Signed-off-by: Kees Cook --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 5f

Re: [PATCH v2 62/89] pstore: convert to new timestamp accessors

2023-10-04 Thread Kees Cook
On Wed, Oct 04, 2023 at 02:52:47PM -0400, Jeff Layton wrote: > Convert to using the new inode timestamp accessor functions. > > Signed-off-by: Jeff Layton Acked-by: Kees Cook -- Kees Cook

[PATCH v2 62/89] pstore: convert to new timestamp accessors

2023-10-04 Thread Jeff Layton
Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/pstore/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 585360706b33..d41c20d1b5e8 100644 --- a/fs/pstore/inode.c +++ b/fs/ps

Re: [PATCH] net/mlx5: Annotate struct mlx5_flow_handle with __counted_by

2023-10-04 Thread Leon Romanovsky
On Tue, Oct 03, 2023 at 04:17:30PM -0700, Kees Cook 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)

Re: [PATCH] net/mlx5: Annotate struct mlx5_fc_bulk with __counted_by

2023-10-04 Thread Leon Romanovsky
On Tue, Oct 03, 2023 at 04:21:05PM -0700, Justin Stitt wrote: > On Tue, Oct 3, 2023 at 4:17 PM Kees Cook 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-ch

[linux-next:master] BUILD REGRESSION 33b64befb1a28bca3f5a9ed9807d2f87e976c63a

2023-10-04 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master branch HEAD: 33b64befb1a28bca3f5a9ed9807d2f87e976c63a Add linux-next specific files for 20231004 Error/Warning reports: https://lore.kernel.org/oe-kbuild-all/202309122047.cri9yjrq-...@intel.com https

Re: [PATCH] ASoC: soc-dapm: Annotate struct snd_soc_dapm_widget_list with __counted_by

2023-10-04 Thread Mark Brown
On Tue, 03 Oct 2023 16:28:53 -0700, Kees Cook 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 C

Re: [PATCH v2] net: sched: cls_u32: Fix allocation size in u32_init()

2023-10-04 Thread Jamal Hadi Salim
On Wed, Oct 4, 2023 at 9:19 AM Gustavo A. R. Silva wrote: > > commit d61491a51f7e ("net/sched: cls_u32: Replace one-element array > with flexible-array member") incorrecly replaced an instance of > `sizeof(*tp_c)` with `struct_size(tp_c, hlist->ht, 1)`. This results > in a an over-allocation of 8

Re: [PATCH] dmaengine: ep93xx_dma: Annotate struct ep93xx_dma_engine with __counted_by

2023-10-04 Thread Vinod Koul
On Thu, 28 Sep 2023 16:43:42 -0700, Kees Cook 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

Re: [PATCH] dmaengine: fsl-edma: Annotate struct struct fsl_edma_engine with __counted_by

2023-10-04 Thread Vinod Koul
On Tue, 03 Oct 2023 16:27:56 -0700, Kees Cook 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

[PATCH v2] net: sched: cls_u32: Fix allocation size in u32_init()

2023-10-04 Thread Gustavo A. R. Silva
commit d61491a51f7e ("net/sched: cls_u32: Replace one-element array with flexible-array member") incorrecly replaced an instance of `sizeof(*tp_c)` with `struct_size(tp_c, hlist->ht, 1)`. This results in a an over-allocation of 8 bytes. This change is wrong because `hlist` in `struct tc_u_common`

Re: [PATCH v1 1/1] kernel.h: Move lib/cmdline.c prototypes to string.h

2023-10-04 Thread Andy Shevchenko
On Wed, Oct 4, 2023 at 2:39 AM Kees Cook wrote: > > On Tue, Oct 03, 2023 at 04:01:42PM +0300, Andy Shevchenko wrote: > > The lib/cmdline.c is basically a set of some small string parsers > > which are wide used in the kernel. Their prototypes belong to the > > string.h rather then kernel.h. > > >

Re: [PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

2023-10-04 Thread Ingo Molnar
* Justin Stitt wrote: > strncpy works perfectly here in all cases, however, it is deprecated and > as such we should prefer more robust and less ambiguous string apis. > > Let's use `strtomem_pad` as this matches the functionality of `strncpy` > and is _not_ deprecated. > > Link: > https://w