tracing: Do not create directories if lockdown is in affect
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 2 Dec 2019 21:25:27 +0000 (16:25 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Jan 2020 11:21:45 +0000 (12:21 +0100)
commitb301cb2f19d081bd8e136e9c6466737d76031d44
tree5211a63d82154b6a3fd6d57846ed77022e8f6da6
parent8b8cd873c727b8aa3e809d1d071b82f3f1968a53
tracing: Do not create directories if lockdown is in affect

commit a356646a56857c2e5ad875beec734d7145ecd49a upstream.

If lockdown is disabling tracing on boot up, it prevents the tracing files
from even bering created. But when that happens, there's several places that
will give a warning that the files were not created as that is usually a
sign of a bug.

Add in strategic locations where a check is made to see if tracing is
disabled by lockdown, and if it is, do not go further, and fail silently
(but print that tracing is disabled by lockdown, without doing a WARN_ON()).

Cc: Matthew Garrett <mjg59@google.com>
Fixes: 17911ff38aa5 ("tracing: Add locked_down checks to the open calls of files created for tracefs")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/ring_buffer.c
kernel/trace/trace.c