Subject: Re: [PATCH v5] kptr_restrict for hiding kernel pointers

From: Dan Rosenberg <[email-masked]>
Date: Wed, 22 Dec 2010 12:19:54 -0500

On Wed, 2010-12-22 at 12:18 -0500, Dan Rosenberg wrote:
> On Wed, 2010-12-22 at 18:13 +0100, Ingo Molnar wrote:
> > * Dan Rosenberg <[email-masked]> wrote:
> > 
> > > +	case 'K':
> > > +		/*
> > > +		 * %pK cannot be used in IRQ context because its test
> > > +		 * for CAP_SYSLOG would be meaningless.
> > > +		 */
> > > +		if (in_irq() || in_serving_softirq() || in_nmi())
> > > +			WARN_ONCE(1, "%%pK used in interrupt context.\n");
> > 
> > Hm, that bit looks possibly broken - some useful warning in irq context could print 
> > a pointer into the syslog and this would generate a second warning? That probably 
> > would crash as it recurses back into the printk code?
> > 
> 
> The double "%%" acts as an escape and simply prints "%" rather than
> treating it as a format specifier.

I apologize, I misunderstood your point at first glance.  I'll consider
this as a potential problem.

-Dan