mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Convert copy_from_user() + kstrtouint() to kstrtouint_from_user()
@ 2026-01-16 13:17 Fushuai Wang
  2026-01-16 13:17 ` [PATCH 1/2] sched/debug: " Fushuai Wang
  2026-01-16 13:17 ` [PATCH 2/2] x86/tlb: " Fushuai Wang
  0 siblings, 2 replies; 4+ messages in thread
From: Fushuai Wang @ 2026-01-16 13:17 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, vschneid, dave.hansen, luto, tglx, bp,
	hpa
  Cc: linux-kernel, x86, wangfushuai, aliceryhl, ynorov

From: Fushuai Wang <wangfushuai@baidu.com>

Hi,

There are several places use copy_from_user() to copy a string from
userspase, followed by kstrtoXXX() to convert it to a desired type.
This approach requires manually handling NUL-termination and proper
buffer sizing, which is error-prone and unnecessarily complex. The
kernel provides kstrtoXXX_from_user() helpers to copy a string from
userspace and perform the conversion in one step. So use a
kstrtoXXX_from_user() instead of copy_from_user() + kstrtoXXX().

Recent discussion:
https://lore.kernel.org/all/20260112073039.1185-1-fushuai.wang@linux.dev/T/

Fushuai Wang (2):
  sched/debug: Convert copy_from_user() + kstrtouint() to
    kstrtouint_from_user()
  x86/tlb: Convert copy_from_user() + kstrtouint() to
    kstrtouint_from_user()

 arch/x86/mm/tlb.c    | 13 ++++---------
 kernel/sched/debug.c | 14 ++++----------
 2 files changed, 8 insertions(+), 19 deletions(-)

-- 
2.36.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-16 17:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-16 13:17 [PATCH 0/2] Convert copy_from_user() + kstrtouint() to kstrtouint_from_user() Fushuai Wang
2026-01-16 13:17 ` [PATCH 1/2] sched/debug: " Fushuai Wang
2026-01-16 17:04   ` Yury Norov
2026-01-16 13:17 ` [PATCH 2/2] x86/tlb: " Fushuai Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®