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] [day] [month] [year] [list]
Message-ID: <6af62f13816f24cd525865c91892d53483748d0e.camel@perches.com>
Date:   Wed, 20 Jan 2021 21:15:43 -0800
From:   Joe Perches <joe@...ches.com>
To:     Bart Van Assche <bvanassche@....org>,
        Jiapeng Zhong <abaci-bugfix@...ux.alibaba.com>,
        njavali@...vell.com
Cc:     mrangankar@...vell.com, GR-QLogic-Storage-Upstream@...vell.com,
        jejb@...ux.ibm.com, martin.petersen@...cle.com,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] scsi/qla4xxx: convert sysfs sprintf/snprintf family
 to sysfs_emit/sysfs_emit_at

On Wed, 2021-01-20 at 20:55 -0800, Bart Van Assche wrote:
> On 1/20/21 7:57 PM, Jiapeng Zhong wrote:
> > -		return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%x)\n",
> > +		return sysfs_emit_at(buf, PAGE_SIZE, "%d.%02d.%02d (%x)\n",
> >  				ha->fw_info.fw_major, ha->fw_info.fw_minor,
> >  				ha->fw_info.fw_patch, ha->fw_info.fw_build);
> 
> From the sysfs_emit_at() source code:
> 
> WARN(... || at >= PAGE_SIZE, "invalid sysfs_emit_at: buf:%p at:%d\n",
> buf, at)
> 
> In other words, this patch is wrong. sysfs_emit() should have been used
> instead of sysfs_emit_at().

Instead, use the cocci script from

commit aa838896d87a ("drivers core: Use sysfs_emit and sysfs_emit_at for
show(device *...) functions")
 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ