Re: [PATCH] scsi: pm80xx: Add __nonstring annotations for unterminated strings

2025-03-10 Thread James Bottomley
On Mon, 2025-03-10 at 15:25 -0700, Kees Cook wrote: > When a character array without a terminating NUL character has a > static > initializer, GCC 15's -Wunterminated-string-initialization will only > warn if the array lacks the "nonstring" attribute[1]. Mark the arrays > with __nonstring to and co

Re: [PATCH] lib: string_helpers: fix potential snprintf() output truncation

2024-10-22 Thread James Bottomley
On Tue, 2024-10-22 at 15:46 +0200, Rasmus Villemoes wrote: [...] > -   snprintf(buf, len, "%u%s %s", (u32)size, > -    tmp, unit); > +   if (j) > +   snprintf(buf, len, "%u.%03u %s", (u32)size, > remainder, unit); > +   else > +   snprintf(buf, len, "

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

2024-07-11 Thread James Bottomley
On Thu, 2024-07-11 at 08:58 -0700, Kees Cook wrote: > Replace the deprecated[1] use of a 1-element array in > struct MR_HOST_DEVICE_LIST with a modern flexible array. > > One binary difference appears in megasas_host_device_list_query(): > >     struct MR_HOST_DEVICE_LIST *ci; > ... >

Re: [PATCH v3] scsi: csiostor: Use kcalloc() instead of kzalloc()

2024-05-01 Thread James Bottomley
On Mon, 2024-04-29 at 13:13 -0700, Kees Cook wrote: > On Mon, Apr 29, 2024 at 02:31:19PM -0400, Martin K. Petersen wrote: > > > > Kees, > > > > > > This patch seems to be lost. Gustavo reviewed it on January 15, > > > > 2024 but the patch has not been applied since. > > > > > > This looks correc

Re: [PATCH 03/10] scsi: NCR5380: Replace snprintf() with the safer scnprintf() variant

2024-02-19 Thread James Bottomley
On Mon, 2024-02-19 at 15:23 +, Lee Jones wrote: > On Sat, 10 Feb 2024, James Bottomley wrote: > > > On Thu, 2024-02-08 at 10:29 +, Lee Jones wrote: > > > On Thu, 08 Feb 2024, Geert Uytterhoeven wrote: > > > > > > > Hi Lee, > > > >

Re: [PATCH 03/10] scsi: NCR5380: Replace snprintf() with the safer scnprintf() variant

2024-02-10 Thread James Bottomley
On Thu, 2024-02-08 at 10:29 +, Lee Jones wrote: > On Thu, 08 Feb 2024, Geert Uytterhoeven wrote: > > > Hi Lee, > > > > Thanks for your patch! > > > > On Thu, Feb 8, 2024 at 9:48 AM Lee Jones wrote: > > > There is a general misunderstanding amongst engineers that > > > {v}snprintf() > > > re

Re: the nul-terminated string helper desk chair rearrangement

2023-10-26 Thread James Bottomley
On Thu, 2023-10-26 at 15:44 +0200, Andrew Lunn wrote: > > > > [1]: > > > > https://elixir.bootlin.com/linux/v6.6-rc6/source/include/linux/fortify-string.h#L292 > > I found that https://elixir.bootlin.com/linux That's a 404, I think you mean https://elixir.bootlin.com/linux/latest/source >  is t

Re: the nul-terminated string helper desk chair rearrangement

2023-10-26 Thread James Bottomley
On Thu, 2023-10-26 at 12:01 +0200, Christoph Hellwig wrote: > > > There's some docs at [1]. Perhaps there could be more? > > > > > > [1]: > > > https://elixir.bootlin.com/linux/v6.6-rc6/source/include/linux/fortify-string.h#L292 > > > > Right, And it's even valid kern-doc, which gets rendered in