mbox series

[v2,0/7] scsi: replace deprecated strncpy

Message ID 20240228-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v2-0-dacebd3fcfa0@google.com (mailing list archive)
Headers show
Series scsi: replace deprecated strncpy | expand

Message

Justin Stitt Feb. 28, 2024, 10:59 p.m. UTC
This series contains multiple replacements of strncpy throughout the
scsi subsystem.

strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces. The details of each replacement will be in their respective
patch.

---
Changes in v2:
- for (1/7): change strscpy to simple const char* assignments
- Link to v1: https://lore.kernel.org/r/20240223-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v1-0-9cd3882f0700@google.com

---
Justin Stitt (7):
      scsi: mpi3mr: replace deprecated strncpy with assignments
      scsi: mpt3sas: replace deprecated strncpy with strscpy
      scsi: qedf: replace deprecated strncpy with strscpy
      scsi: qla4xxx: replace deprecated strncpy with strscpy
      scsi: devinfo: replace strncpy and manual pad
      scsi: smartpqi: replace deprecated strncpy with strscpy
      scsi: wd33c93: replace deprecated strncpy with strscpy

 drivers/net/ethernet/qlogic/qed/qed_main.c |  2 +-
 drivers/scsi/mpi3mr/mpi3mr_fw.c            | 10 +++++-----
 drivers/scsi/mpt3sas/mpt3sas_base.c        |  2 +-
 drivers/scsi/mpt3sas/mpt3sas_transport.c   | 18 +++++++++---------
 drivers/scsi/qedf/qedf_main.c              |  2 +-
 drivers/scsi/qla4xxx/ql4_mbx.c             | 17 ++++++++++++-----
 drivers/scsi/qla4xxx/ql4_os.c              | 14 +++++++-------
 drivers/scsi/scsi_devinfo.c                | 18 ++++++++++--------
 drivers/scsi/smartpqi/smartpqi_init.c      |  5 ++---
 drivers/scsi/wd33c93.c                     |  4 +---
 10 files changed, 49 insertions(+), 43 deletions(-)
---
base-commit: 39133352cbed6626956d38ed72012f49b0421e7b
change-id: 20240222-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-1b130d51bdcc

Best regards,
--
Justin Stitt <justinstitt@google.com>

Comments

Kees Cook Feb. 29, 2024, 12:18 a.m. UTC | #1
On Wed, Feb 28, 2024 at 10:59:00PM +0000, Justin Stitt wrote:
> This series contains multiple replacements of strncpy throughout the
> scsi subsystem.
> 
> strncpy() is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces. The details of each replacement will be in their respective
> patch.
> 
> ---
> Changes in v2:
> - for (1/7): change strscpy to simple const char* assignments
> - Link to v1: https://lore.kernel.org/r/20240223-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v1-0-9cd3882f0700@google.com

I think you lost my tags for the later patches. I re-reviewed a few and
then remembered I'd already reviewed these and they were unchanged. :)

Please run:

b4 trailers -u 20240223-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v1-0-9cd3882f0700@google.com

:)

-Kees
Justin Stitt March 5, 2024, 11:35 p.m. UTC | #2
On Wed, Feb 28, 2024 at 4:18 PM Kees Cook <keescook@chromium.org> wrote:
>
> On Wed, Feb 28, 2024 at 10:59:00PM +0000, Justin Stitt wrote:
> > This series contains multiple replacements of strncpy throughout the
> > scsi subsystem.
> >
> > strncpy() is deprecated for use on NUL-terminated destination strings
> > [1] and as such we should prefer more robust and less ambiguous string
> > interfaces. The details of each replacement will be in their respective
> > patch.
> >
> > ---
> > Changes in v2:
> > - for (1/7): change strscpy to simple const char* assignments
> > - Link to v1: https://lore.kernel.org/r/20240223-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v1-0-9cd3882f0700@google.com
>
> I think you lost my tags for the later patches. I re-reviewed a few and
> then remembered I'd already reviewed these and they were unchanged. :)
>
> Please run:
>
> b4 trailers -u 20240223-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v1-0-9cd3882f0700@google.com

Gotcha, I've resent [1]

I've also added this into my scripting so I shouldn't miss any future
trailers from vN to vN+1. :)

>
> :)
>
> -Kees
>
> --
> Kees Cook

[1]: https://lore.kernel.org/r/20240305-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v3-0-5b78a13ff984@google.com