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.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -136,8 +136,8 @@ static int parse_one(char *param, · 135 unmodified lines | ||
| 136 | 136 | if (!val && |
| 137 | 137 | !(params[i].ops->flags & KERNEL_PARAM_OPS_FL_NOARG)) |
| 138 | 138 | 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"); | |
| 141 | 141 | kernel_param_lock(params[i].mod); |
| 142 | 142 | if (param_check_unsafe(¶ms[i])) |
| 143 | 143 | err = params[i].ops->set(val, ¶ms[i]); |