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: <88b08a41-55b2-ae5d-fbe5-24439429855f@acm.org>
Date:   Sat, 18 Jul 2020 13:25:55 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     Xiongfeng Wang <wangxiongfeng2@...wei.com>, jejb@...ux.ibm.com,
        martin.petersen@...cle.com, john.garry@...wei.com
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        guohanjun@...wei.com
Subject: Re: [PATCH v2] scsi: scsi_transport_sas: add missing newline when
 printing 'enable' by sysfs

On 2020-07-17 01:44, Xiongfeng Wang wrote:
> diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
> index 182fd25..e443dee 100644
> --- a/drivers/scsi/scsi_transport_sas.c
> +++ b/drivers/scsi/scsi_transport_sas.c
> @@ -563,7 +563,7 @@ static ssize_t do_sas_phy_enable(struct device *dev,
>  {
>  	struct sas_phy *phy = transport_class_to_phy(dev);
>  
> -	return snprintf(buf, 20, "%d", phy->enabled);
> +	return snprintf(buf, 20, "%d\n", phy->enabled);
>  }

For future sysfs show function patches, please use PAGE_SIZE as second
snprintf() argument or use sprintf() instead of snprintf() because in
this case it is clear that no output buffer overflow will happen. Using
any other size argument than PAGE_SIZE makes patches like the above
harder to verify than necessary. Anyway:

Reviewed-by: Bart van Assche <bvanassche@....org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ