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]
Message-ID: <e177acba-24d3-4202-a0a8-92bfbfdf87e7@suse.cz>
Date: Mon, 17 Mar 2025 07:07:23 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: xie.ludan@....com.cn, tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH linux-next] genirq: use sysfs_emit() instead of
 scnprintf().

Hi,

your e-mail is both multipart and base64 encoded :(. Pls fix up your 
setup first.

On 15. 03. 25, 7:17, 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>
> 
> ---
> 
>   kernel/irq/irqdesc.c | 12 ++++++------
> 
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> 
> diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
> 
> index 287830739783..8ffe12fe5af6 100644
> 
> --- a/kernel/irq/irqdesc.c
> 
> +++ b/kernel/irq/irqdesc.c
> 
> @@ -257,11 +257,11 @@ static ssize_t per_cpu_count_show(struct kobject 
> *kobj,
> 
> for_each_possible_cpu(cpu) {
> 
> unsigned int c = irq_desc_kstat_cpu(desc, cpu);
> 
> -ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%u", p, c);
> 
> +ret += sysfs_emit(buf + ret, "%s%u", p, c);

Well, so the PAGE_SIZE boundary is never checked for this stacking write 
now, right?

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ