Re: [v2] wifi: ipw2x00: refactor to use kstrtoul

From: Kalle Valo
Date: Mon Aug 21 2023 - 12:10:35 EST


Justin Stitt <justinstitt@xxxxxxxxxx> 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].
>
> Compile tested only.
>
> 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@xxxxxxxxxxxxxxx
> Suggested-by: Kees Cook <keescook@xxxxxxxxxxxx>
> Signed-off-by: Justin Stitt <justinstitt@xxxxxxxxxx>
> Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

Patch applied to wireless-next.git, thanks.

876777494634 wifi: ipw2x00: refactor to use kstrtoul

--
https://patchwork.kernel.org/project/linux-wireless/patch/20230802-wifi-ipw2x00-refactor-v2-1-d33f765e9cd5@xxxxxxxxxx/

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