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:
Jim Cromie
2026-06-18 13:07:15 -06:00
committed by Andrew Morton
parent c04cffb8c5
commit b4e28b4db7

View File

@@ -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(&params[i]))
err = params[i].ops->set(val, &params[i]);