History

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.

Jim Cromie committed 4 months ago

Commit b4e28b41 parent c04cffb1 file · +2 −2Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/params.c+2−2
@@ -136,8 +136,8 @@ static int parse_one(char *param, · 135 unmodified lines
136136 if (!val &&
137137 !(params[i].ops->flags & KERNEL_PARAM_OPS_FL_NOARG))
138138 return -EINVAL;
139− pr_debug("handling %s with %p\n", param,
140− params[i].ops->set);
139+ pr_debug("handling %s with value '%s'\n", param,
140+ val ? val : "no-arg");
141141 kernel_param_lock(params[i].mod);
142142 if (param_check_unsafe(&params[i]))
143143 err = params[i].ops->set(val, &params[i]);