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

From: Steven Rostedt
Date: Tue Apr 03 2018 - 18:03:22 EST


On Tue, 3 Apr 2018 14:43:43 -0700
Kees Cook <keescook@xxxxxxxxxxxx> wrote:

> > A static_key is added called "trace_debug" and if it is set, then %p will
> > not be hashed.
>
> Hrm, well, using a static key does make it weirder for an attacker to enable. :)

Not just weirder, much more difficult. static_keys are read only (code
segments). To enable them, the system makes the code portion rw updates
the code, then sets it back to ro.

>
> Whatever the case, if you can get Linus's Ack, sure. I would expect

Linus you OK with this?

> he'd want you to change all the trace_printk()s to %px with
> justifications, though.

What trace_printk()s do you want to change? They are throw away
functions. trace_printk() is not something that stays in the kernel.
It's added during debugging and then removed before submitting what you
are working on upstream. It's just annoying to have to use %px instead
of %p when debugging.

-- Steve