Re: [PATCH v2] scsi: hpsa: Replace deprecated strncpy() with strscpy_pad()

2025-02-18 Thread Martin K. Petersen
Thorsten, > strncpy() is deprecated for NUL-terminated destination buffers. > Replace memset() and strncpy() with strscpy_pad() to copy the version > string and fill the remaining bytes in the destination buffer with NUL > bytes. This avoids zeroing the memory before copying the string. Applied

Re: [PATCH v2] scsi: hpsa: Replace deprecated strncpy() with strscpy_pad()

2025-02-13 Thread Kees Cook
On Thu, Feb 13, 2025 at 10:24:25AM -0800, Bart Van Assche wrote: > On 2/13/25 3:40 AM, Thorsten Blum wrote: > > diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c > > index c7ebae24b09f..968cefb497eb 100644 > > --- a/drivers/scsi/hpsa.c > > +++ b/drivers/scsi/hpsa.c > > @@ -7236,8 +7236,7 @@ st

Re: [PATCH v2] scsi: hpsa: Replace deprecated strncpy() with strscpy_pad()

2025-02-13 Thread Bart Van Assche
On 2/13/25 3:40 AM, Thorsten Blum wrote: diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index c7ebae24b09f..968cefb497eb 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -7236,8 +7236,7 @@ static int hpsa_controller_hard_reset(struct pci_dev *pdev, static void init_driv