[PATCH] ARM: mm: Don't use %pK through printk

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Feb 18 02:41:13 PST 2025


On Tue, Feb 18, 2025 at 10:27:49AM +0000, Russell King (Oracle) wrote:
> On Mon, Feb 17, 2025 at 08:38:37AM +0100, Thomas Weißschuh wrote:
> > Restricted pointers ("%pK") are not meant to be used through printk().
> > It can unintentionally expose security sensitive, raw pointer values.
> > 
> > Use regular pointer formatting instead.
> 
> ... which means that the warning is pointless because no one can debug
> it when someone reports that this has fired.

For the most common setups which using the default kptr_restrict=0,
%pK is already the same as %p.

> While I get the security issue, changing this is severely harmful to
> fixing problems should this warning fire.

My next goal is to get rid of the easy to misuse %pK.
If the address is really always important then %px can be used.


Thomas



More information about the linux-arm-kernel mailing list