Skip to content

Commit

Permalink
kernel/params.c: downgrade warning for unsafe parameters
Browse files Browse the repository at this point in the history
As using an unsafe module parameter is, by its very definition, an
expected user action, emitting a warning is overkill.  Nothing has yet
gone wrong, and we add a taint flag for any future oops should something
actually go wrong.  So instead of having a user controllable pr_warn,
downgrade it to a pr_notice for "a normal, but significant condition".

We make use of unsafe kernel parameters in igt
(https://cgit.freedesktop.org/drm/igt-gpu-tools/) (we have not yet
succeeded in removing all such debugging options), which generates a
warning and taints the kernel.  The warning is unhelpful as we then need
to filter it out again as we check that every test themselves do not
provoke any kernel warnings.

Link: http://lkml.kernel.org/r/[email protected]
Fixes: 91f9d33 ("module: make it possible to have unsafe, tainting module params")
Signed-off-by: Chris Wilson <[email protected]>
Acked-by: Jani Nikula <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Jean Delvare <[email protected]>
Cc: Li Zhong <[email protected]>
Cc: Petri Latvala <[email protected]>
Cc: Daniel Vetter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
ickle authored and torvalds committed Apr 11, 2018
1 parent 2d87b30 commit edc41b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/params.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ bool parameq(const char *a, const char *b)
static void param_check_unsafe(const struct kernel_param *kp)
{
if (kp->flags & KERNEL_PARAM_FL_UNSAFE) {
pr_warn("Setting dangerous option %s - tainting kernel\n",
kp->name);
pr_notice("Setting dangerous option %s - tainting kernel\n",
kp->name);
add_taint(TAINT_USER, LOCKDEP_STILL_OK);
}
}
Expand Down

0 comments on commit edc41b3

Please sign in to comment.