lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <SJ0PR11MB5896B37C2998850BF11B58F0C3DE2@SJ0PR11MB5896.namprd11.prod.outlook.com>
Date: Tue, 18 Mar 2025 01:48:03 +0000
From: "Karan Tilak Kumar (kartilak)" <kartilak@...co.com>
To: Thorsten Blum <thorsten.blum@...ux.dev>, "Satish Kharat (satishkh)"
	<satishkh@...co.com>, "Sesidhar Baddela (sebaddel)" <sebaddel@...co.com>,
	"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>, "Martin K.
 Petersen" <martin.petersen@...cle.com>
CC: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] scsi: fnic: Remove unnecessary NUL-terminations

On Friday, March 14, 2025 3:16 PM, Thorsten Blum <thorsten.blum@...ux.dev> wrote:
>
> strscpy_pad() already NUL-terminates 'data' at the corresponding
> indexes. Remove any unnecessary NUL-terminations.
>
> No functional changes intended.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> ---
> drivers/scsi/fnic/fdls_disc.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/scsi/fnic/fdls_disc.c b/drivers/scsi/fnic/fdls_disc.c
> index 11211c469583..7294645ed6d2 100644
> --- a/drivers/scsi/fnic/fdls_disc.c
> +++ b/drivers/scsi/fnic/fdls_disc.c
> @@ -1898,7 +1898,6 @@ static void fdls_fdmi_register_hba(struct fnic_iport_s *iport)
> if (fnic->subsys_desc_len >= FNIC_FDMI_MODEL_LEN)
> fnic->subsys_desc_len = FNIC_FDMI_MODEL_LEN - 1;
> strscpy_pad(data, fnic->subsys_desc, FNIC_FDMI_MODEL_LEN);
> -     data[FNIC_FDMI_MODEL_LEN - 1] = 0;
> fnic_fdmi_attr_set(fdmi_attr, FNIC_FDMI_TYPE_MODEL, FNIC_FDMI_MODEL_LEN,
> data, &attr_off_bytes);
>
> @@ -2061,7 +2060,6 @@ static void fdls_fdmi_register_pa(struct fnic_iport_s *iport)
> snprintf(tmp_data, FNIC_FDMI_OS_NAME_LEN - 1, "host%d",
> fnic->host->host_no);
> strscpy_pad(data, tmp_data, FNIC_FDMI_OS_NAME_LEN);
> -     data[FNIC_FDMI_OS_NAME_LEN - 1] = 0;
> fnic_fdmi_attr_set(fdmi_attr, FNIC_FDMI_TYPE_OS_NAME,
> FNIC_FDMI_OS_NAME_LEN, data, &attr_off_bytes);
>
> @@ -2071,7 +2069,6 @@ static void fdls_fdmi_register_pa(struct fnic_iport_s *iport)
> sprintf(fc_host_system_hostname(fnic->host), "%s", utsname()->nodename);
> strscpy_pad(data, fc_host_system_hostname(fnic->host),
> FNIC_FDMI_HN_LEN);
> -     data[FNIC_FDMI_HN_LEN - 1] = 0;
> fnic_fdmi_attr_set(fdmi_attr, FNIC_FDMI_TYPE_HOST_NAME,
> FNIC_FDMI_HN_LEN, data, &attr_off_bytes);
>
> --
> 2.48.1
>
>

Looks good to me.

Reviewed-by: Karan Tilak Kumar <kartilak@...co.com>

Regards,
Karan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ