public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: Justin Stitt <justinstitt@google.com>,
	Stanislav Yakovlev <stas.yakovlev@gmail.com>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH v2] wifi: ipw2x00: refactor to use kstrtoul
Date: Fri, 04 Aug 2023 12:05:26 +0300	[thread overview]
Message-ID: <87wmybjhyh.fsf@kernel.org> (raw)
In-Reply-To: <202308040120.183400A04@keescook> (Kees Cook's message of "Fri, 4 Aug 2023 01:21:07 -0700")

Kees Cook <keescook@chromium.org> writes:

> On Wed, Aug 02, 2023 at 01:23:06AM +0000, Justin Stitt wrote:
>> The current implementation seems to reinvent what `kstrtoul` already does
>> in terms of functionality and error handling. Remove uses of `simple_strtoul()`
>> in favor of `kstrtoul()`.
>> 
>> There is the following note at `lib/vsprintf.c:simple_strtoull()` which
>> further backs this change:
>> | * This function has caveats. Please use kstrtoull (or kstrtoul) instead.
>> 
>> And here, simple_str* are explicitly deprecated [3].
>> 
>> This patch also removes an instance of the deprecated `strncpy` which helps [2].
>> 
>> Link: https://lore.kernel.org/all/202308011602.3CC1C0244C@keescook/ [1]
>> Link: https://github.com/KSPP/linux/issues/90 [2]
>> Link:
>> https://docs.kernel.org/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull
>> [3]
>> Cc: linux-hardening@vger.kernel.org
>> Suggested-by: Kees Cook <keescook@chromium.org>
>> Signed-off-by: Justin Stitt <justinstitt@google.com>
>
> This looks correct to me. I would be curious to hear back from the intel
> folks if the interface continues to work correctly with real hardware.
>
> Reviewed-by: Kees Cook <keescook@chromium.org>

This is ancient hardware, not sure if anyone even have a working setup.
And even if they would have one I doubt anyone uses this sysfs interface
for anything.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2023-08-04  9:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02  1:23 [PATCH v2] wifi: ipw2x00: refactor to use kstrtoul Justin Stitt
2023-08-03 12:01 ` Kalle Valo
2023-08-04  8:21 ` Kees Cook
2023-08-04  9:05   ` Kalle Valo [this message]
2023-08-16 20:47     ` Kees Cook
2023-08-21 16:10 ` [v2] " Kalle Valo

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=87wmybjhyh.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=justinstitt@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=stas.yakovlev@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox