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: <20250317171849700zhgNc5lZvWvM3EepJpYWE@zte.com.cn>
Date: Mon, 17 Mar 2025 17:18:49 +0800 (CST)
From: <tang.dongxing@....com.cn>
To: <jirislaby@...nel.org>
Cc: <jgross@...e.com>, <sstabellini@...nel.org>,
        <oleksandr_tyshchenko@...m.com>, <jiqian.chen@....com>,
        <ray.huang@....com>, <jeff.johnson@....qualcomm.com>,
        <minhuadotchen@...il.com>, <xen-devel@...ts.xenproject.org>,
        <linux-kernel@...r.kernel.org>, <ye.xingchen@....com.cn>,
        <yang.guang5@....com.cn>, <yang.yang29@....com.cn>,
        <xu.xin16@....com.cn>
Subject: Re: [PATCH] xen/pciback: use sysfs_emit_at() instead of scnprintf()

>> From: TangDongxing <tang.dongxing@....com.cn>
>> 
>> Follow the advice in Documentation/filesystems/sysfs.rst:
>> show() should only use sysfs_emit() or sysfs_emit_at() when formatting
>> the value to be returned to user space.
>> 
>> Signed-off-by: TangDongxing <tang.dongxing@....com.cn>
>> ---
>>   drivers/xen/xen-pciback/pci_stub.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
>> index b616b7768c3b..a0782a74ed34 100644
>> --- a/drivers/xen/xen-pciback/pci_stub.c
>> +++ b/drivers/xen/xen-pciback/pci_stub.c
>> @@ -1281,7 +1281,7 @@ static ssize_t slots_show(struct device_driver *drv, char *buf)
>>           if (count >= PAGE_SIZE)
>>               break;
>> 
>> -        count += scnprintf(buf + count, PAGE_SIZE - count,
>> +        count += sysfs_emit_at(buf, count,
>
>This is wrong too [1].
>
>[1] 
>https://lore.kernel.org/all/9c552d9a-2d46-4069-a9c4-35fab857bfc3@kernel.org/
>
>regards,
>-- 
>js
>suse labs

Dear JiriSlaby,

Thank you for your feedback,I am sorry for my previous submissions.
I will check my work before sending any further updates.

Thank you for your guidance.

Best regards,
Tang Dongxing
<div class="zcontentRow"><p>&gt;&gt; From: TangDongxing &lt;tang.dongxing@....com.cn&gt;</p><p>&gt;&gt;&nbsp;</p><p>&gt;&gt; Follow the advice in Documentation/filesystems/sysfs.rst:</p><p>&gt;&gt; show() should only use sysfs_emit() or sysfs_emit_at() when formatting</p><p>&gt;&gt; the value to be returned to user space.</p><p>&gt;&gt;&nbsp;</p><p>&gt;&gt; Signed-off-by: TangDongxing &lt;tang.dongxing@....com.cn&gt;</p><p>&gt;&gt; ---</p><p>&gt;&gt;&nbsp; &nbsp;drivers/xen/xen-pciback/pci_stub.c | 2 +-</p><p>&gt;&gt;&nbsp; &nbsp;1 file changed, 1 insertion(+), 1 deletion(-)</p><p>&gt;&gt;&nbsp;</p><p>&gt;&gt; diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c</p><p>&gt;&gt; index b616b7768c3b..a0782a74ed34 100644</p><p>&gt;&gt; --- a/drivers/xen/xen-pciback/pci_stub.c</p><p>&gt;&gt; +++ b/drivers/xen/xen-pciback/pci_stub.c</p><p>&gt;&gt; @@ -1281,7 +1281,7 @@ static ssize_t slots_show(struct device_driver *drv, char *buf)</p><p>&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (count &gt;= PAGE_SIZE)</p><p>&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</p><p>&gt;&gt;&nbsp;</p><p>&gt;&gt; -&nbsp; &nbsp; &nbsp; &nbsp; count += scnprintf(buf + count, PAGE_SIZE - count,</p><p>&gt;&gt; +&nbsp; &nbsp; &nbsp; &nbsp; count += sysfs_emit_at(buf, count,</p><p>&gt;</p><p>&gt;This is wrong too [1].</p><p>&gt;</p><p>&gt;[1]&nbsp;</p><p>&gt;https://lore.kernel.org/all/9c552d9a-2d46-4069-a9c4-35fab857bfc3@kernel.org/</p><p>&gt;</p><p>&gt;regards,</p><p>&gt;--&nbsp;</p><p>&gt;js</p><p>&gt;suse labs</p><p><br></p><p>Dear JiriSlaby,</p><p><br></p><p>Thank you for your feedback,I am sorry for my previous submissions.</p><p>I will check my work before sending any further updates.</p><p><br></p><p>Thank you for your guidance.</p><p><br></p><p>Best regards,</p><p>Tang Dongxing</p><p><br></p></div>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ