Linux driver-core infrastructure
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jiangshan Yi <yijiangshan@kylinos.cn>
Cc: johannes@sipsolutions.net, rafael@kernel.org, dakr@kernel.org,
	linux-kernel@vger.kernel.org, driver-core@lists.linux.dev,
	13667453960@163.com
Subject: Re: [PATCH] base: devcoredump: Replace simple_strtol with kstrtol
Date: Mon, 20 Jul 2026 14:55:47 +0200	[thread overview]
Message-ID: <2026072024-eggbeater-strewn-87ed@gregkh> (raw)
In-Reply-To: <20260720125035.891018-1-yijiangshan@kylinos.cn>

On Mon, Jul 20, 2026 at 08:50:35PM +0800, Jiangshan Yi wrote:
> The disabled_store() function uses simple_strtol(), which is marked
> obsolete. simple_strtol() does not provide error handling on invalid
> input - it silently returns a partial parse result or 0, which the
> 'if (tmp != 1) return -EINVAL' check then accepts as a legitimate
> non-1 value.
> 
> Replace simple_strtol(buf, NULL, 10) with kstrtol(buf, 10, &tmp),
> which returns an error code on invalid input. This makes the write-once
> lockdown attribute stricter: malformed input (e.g. trailing garbage)
> now returns -EINVAL instead of being silently treated as a non-1 value
> that the caller wanted to reject anyway.

Be careful, we are rejecting ABI changes like this as there is no real
reason to change this at this point in time, right?

thanks,

greg k-h

  reply	other threads:[~2026-07-20 13:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 12:50 [PATCH] base: devcoredump: Replace simple_strtol with kstrtol Jiangshan Yi
2026-07-20 12:55 ` Greg KH [this message]
2026-07-21  3:36   ` Jiangshan Yi

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=2026072024-eggbeater-strewn-87ed@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=13667453960@163.com \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=yijiangshan@kylinos.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox