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]
Date:   Mon, 17 May 2021 19:49:37 +0800
From:   "yekai(A)" <yekai13@...wei.com>
To:     Greg KH <gregkh@...uxfoundation.org>
CC:     <linux-accelerators@...ts.ozlabs.org>,
        <linux-kernel@...r.kernel.org>, <linuxarm@...wei.com>,
        <zhangfei.gao@...aro.org>, <wangzhou1@...ilicon.com>
Subject: Re: [PATCH] uacce: use sysfs_emit instead of sprintf



On 2021/5/17 18:36, Greg KH wrote:
> On Mon, May 17, 2021 at 06:25:37PM +0800, Kai Ye wrote:
>> Use the sysfs_emit to replace sprintf.
>
> That says _what_ you did, not _why_ you are doing this.  What problem
> are you solving with this change?
>
> thanks,
>
> greg k-h
> .
>
sprintf is not safe, and it not recommended to use.
sprintf does not know the PAGE_SIZE maximum of the temporary buffer
used for outputting sysfs content and it's possible to overrun the
PAGE_SIZE buffer length. so used sysfs_emit that  knows that the size
of the call situations that also ensures that no overrun is done. so use 
sysfs_emit to replace sprintf maybe better.

thanks,
Kai Ye

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ