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.
Unified · Split
| @@ -136,8 +136,8 @@ static int parse_one(char *param, · 135 unmodified lines | |||
| 136 | if (!val && | 136 | if (!val && |
| 137 | !(params[i].ops->flags & KERNEL_PARAM_OPS_FL_NOARG)) | 137 | !(params[i].ops->flags & KERNEL_PARAM_OPS_FL_NOARG)) |
| 138 | return -EINVAL; | 138 | return -EINVAL; |
| 139 | pr_debug("handling %s with %p\n", param, | 139 | pr_debug("handling %s with value '%s'\n", param, |
| 140 | params[i].ops->set); | 140 | val ? val : "no-arg"); |
| 141 | kernel_param_lock(params[i].mod); | 141 | kernel_param_lock(params[i].mod); |
| 142 | if (param_check_unsafe(¶ms[i])) | 142 | if (param_check_unsafe(¶ms[i])) |
| 143 | err = params[i].ops->set(val, ¶ms[i]); | 143 | err = params[i].ops->set(val, ¶ms[i]); |