All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Yu <chen.yu@linux.dev>
To: Zhan Xusheng <zhanxusheng1024@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Mel Gorman <mgorman@suse.de>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>,
	Valentin Schneider <vschneid@redhat.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	zhanxusheng@xiaomi.com, linux-kernel@vger.kernel.org,
	yu.c.chen@intel.com
Subject: Re: [PATCH] sched/debug: Validate writes to the scan_size_mb debugfs knob
Date: Mon, 10 Aug 2026 21:57:17 +0800	[thread overview]
Message-ID: <annYvfbWRmZiquOf@three-body> (raw)
In-Reply-To: <20260810081829.3149958-1-zhanxusheng@xiaomi.com>

On Mon, Aug 10, 2026 at 04:18:29PM +0800, Zhan Xusheng wrote:
> +static ssize_t sched_numa_scan_size_write(struct file *filp,
> +					  const char __user *ubuf,
> +					  size_t cnt, loff_t *ppos)
> +{
> +	unsigned int mb;
> +	int ret;
> +
> +	ret = kstrtouint_from_user(ubuf, cnt, 10, &mb);
>

minor
ret = kstrtouint_from_user(ubuf, cnt, 0, &mb)?

The debugfs_create_u32() path being replaced parses with base 0 via
kstrtoull(attr->set_buf, 0, &val) in simple_attr_write_xsigned(), so
base 10 makes writes like "echo 0x100 > scan_size_mb" return -EINVAL.

Others look ok to me, with above fix, per my knowledge,

Reviewed-by: Chen Yu <yu.c.chen@intel.com>

thanks,
Chenyu 

      reply	other threads:[~2026-08-10 13:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10  8:18 [PATCH] sched/debug: Validate writes to the scan_size_mb debugfs knob Zhan Xusheng
2026-08-10 13:57 ` Chen Yu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=annYvfbWRmZiquOf@three-body \
    --to=chen.yu@linux.dev \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yu.c.chen@intel.com \
    --cc=zhanxusheng1024@gmail.com \
    --cc=zhanxusheng@xiaomi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.