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

2024-05-11 Thread Erick Archer
Hi James, On Sat, May 11, 2024 at 01:18:46PM +0200, Erick Archer wrote: > Hi Martin, Kees and Finn, > > On Sat, Mar 30, 2024 at 05:17:53PM +0100, Erick Archer wrote: > > Use 2-factor multiplication argument form kcalloc() instead > > of kzalloc(). > > > > Also, it is preferred to use sizeof(*poi

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

2024-05-11 Thread Erick Archer
Hi Martin, Kees and Finn, On Sat, Mar 30, 2024 at 05:17:53PM +0100, Erick Archer wrote: > Use 2-factor multiplication argument form kcalloc() instead > of kzalloc(). > > Also, it is preferred to use sizeof(*pointer) instead of > sizeof(type) due to the type of the variable can change and > one ne

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

2024-05-01 Thread Finn Thain
On Wed, 1 May 2024, James Bottomley wrote: > > The code itself is fine unless you have a 32-bit system with a > > malicious card, so yeah, near zero risk. > > Well, no actually zero: we assume plugged in hardware to operate > correctly (had this argument in the driver hardening thread a while

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 v3] scsi: csiostor: Use kcalloc() instead of kzalloc()

2024-04-29 Thread Finn Thain
On Mon, 29 Apr 2024, Kees Cook wrote: > this isn't a case where we can show identical binary output, since this > actively adds overflow checking via kcalloc() internals. > > ... > > it is a trivially correct change that uses a more robust API and more > idiomatic allocation sizeof()s If a

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

2024-04-29 Thread Kees Cook
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 correct to me. I can pick this up if no one else snags it? > > I guess my or

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

2024-04-29 Thread Martin K. Petersen
Kees, >> This patch seems to be lost. Gustavo reviewed it on January 15, 2024 >> but the patch has not been applied since. > > This looks correct to me. I can pick this up if no one else snags it? I guess my original reply didn't make it out, I don't see it in the archives. My objections were:

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

2024-04-29 Thread Kees Cook
On Sat, Mar 30, 2024 at 05:17:53PM +0100, Erick Archer wrote: > Use 2-factor multiplication argument form kcalloc() instead > of kzalloc(). > > Also, it is preferred to use sizeof(*pointer) instead of > sizeof(type) due to the type of the variable can change and > one needs not change the former (

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

2024-04-27 Thread Erick Archer
On Sat, Mar 30, 2024 at 05:17:53PM +0100, Erick Archer wrote: > Use 2-factor multiplication argument form kcalloc() instead > of kzalloc(). > > Also, it is preferred to use sizeof(*pointer) instead of > sizeof(type) due to the type of the variable can change and > one needs not change the former (