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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <23781043-901b-422c-8199-10aa4a31459e@kernel.org>
Date: Mon, 17 Mar 2025 09:50:47 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: tang.dongxing@....com.cn, jgross@...e.com
Cc: 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()

On 17. 03. 25, 8:16, tang.dongxing@....com.cn wrote:
> 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ