mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 17:35:18 -04:00
kernel/params: fix a pr_debug(" %p ") in parse_one()
Inside parse_one(), the core parameter-parsing engine prints the address
of the parameter-set callback function using %p: pr_debug("handling %s
with %p\n", param, params[i].ops->set);
Since the string value of the parameter being parsed (val) is already
available, print the parameter name and its value instead, and avoid
tainting the kernel by exposing a kernel-ptr.
Link: https://lore.kernel.org/20260618190715.3563047-1-jim.cromie@gmail.com
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
c04cffb8c5
commit
b4e28b4db7
@@ -136,8 +136,8 @@ static int parse_one(char *param,
|
||||
if (!val &&
|
||||
!(params[i].ops->flags & KERNEL_PARAM_OPS_FL_NOARG))
|
||||
return -EINVAL;
|
||||
pr_debug("handling %s with %p\n", param,
|
||||
params[i].ops->set);
|
||||
pr_debug("handling %s with value '%s'\n", param,
|
||||
val ? val : "no-arg");
|
||||
kernel_param_lock(params[i].mod);
|
||||
if (param_check_unsafe(¶ms[i]))
|
||||
err = params[i].ops->set(val, ¶ms[i]);
|
||||
|
||||
Reference in New Issue
Block a user