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: <feb009f6-79b9-499e-a909-3d27c4fb9fad@kernel.org>
Date: Mon, 17 Mar 2025 07:20:54 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: xie.ludan@....com.cn, mark@...heh.com
Cc: jlbec@...lplan.org, joseph.qi@...ux.alibaba.com,
 akpm@...ux-foundation.org, viro@...iv.linux.org.uk, brauner@...nel.org,
 danielyangkang@...il.com, dmantipov@...dex.ru, ocfs2-devel@...ts.linux.dev,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH linux-next] ocfs2: use sysfs_emit() instead of
 scnprintf().

On 15. 03. 25, 7:16, xie.ludan@....com.cn wrote:
> From: XieLudan <xie.ludan@....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: XieLudan <xie.ludan@....com.cn>
> 
> ---
> 
>   fs/ocfs2/cluster/heartbeat.c | 10 +++++-----
> 
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
> 
> index 724350925aff..8282fc193906 100644
> 
> --- a/fs/ocfs2/cluster/heartbeat.c
> 
> +++ b/fs/ocfs2/cluster/heartbeat.c
> 
> @@ -1308,7 +1308,7 @@ static int o2hb_debug_open(struct inode *inode, 
> struct file *file)
> 
> case O2HB_DB_TYPE_REGION_NUMBER:
> 
> reg = (struct o2hb_region *)db->db_data;
> 
> -out += scnprintf(buf + out, PAGE_SIZE - out, "%d\n",
> 
> +out += sysfs_emit(buf + out, "%d\n",


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