Re: [RFC][PATCH] tracing, printk: Force no hashing when trace_printk() is used

From: Kees Cook
Date: Tue Apr 03 2018 - 16:08:06 EST


On Tue, Apr 3, 2018 at 12:41 PM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> Both trace_debug is set and kptr_restrict is set to zero in the same
> code that produces the above banner. This will allow trace_printk() to
> not be affected by security code, as trace_printk() should never be run
> on a machine that needs security of this kind.

While I think it'd be nice to have a boot-time knob for this (a debate
that was unsuccessful in earlier threads), I remain skeptical of
having a _runtime_ knob for this, as then it becomes a target (and
yes, there are plenty of targets, but why add another).

If this was __ro_after_init, maybe that'd be nicer. CONFIG_TRACING=y
is used everywhere, so this is really just the whole knob debate over
again. Instead, I've been following Linus's distillation of %p usage
in the kernel:

http://lkml.kernel.org/r/CA+55aFwQEd_d40g4mUCSsVRZzrFPUJt74vc6PPpb675hYNXcKw@xxxxxxxxxxxxxx

-Kees

--
Kees Cook
Pixel Security