netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-security-module@vger.kernel.org, jmorris@namei.org,
	eric.dumazet@gmail.com, tgraf@infradead.org,
	eugeneteo@kernel.org, kees.cook@canonical.com,
	davem@davemloft.net, a.p.zijlstra@chello.nl,
	akpm@linux-foundation.org, eparis@parisplace.org
Subject: Re: [PATCH v5] kptr_restrict for hiding kernel pointers
Date: Wed, 22 Dec 2010 16:43:36 -0500	[thread overview]
Message-ID: <34753.1293054216@localhost> (raw)
In-Reply-To: Your message of "Wed, 22 Dec 2010 12:17:59 EST." <1293038279.9820.250.camel@dan>

[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]

On Wed, 22 Dec 2010 12:17:59 EST, Dan Rosenberg said:
> On Wed, 2010-12-22 at 18:13 +0100, Ingo Molnar wrote:
> > * Dan Rosenberg <drosenberg@vsecurity.com> 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 think Ingo was more worried about the fact that we're doing a WARN_ONCE which
will generate a call to printk() - while we're in the middle of a printk() already.

So if we hit a 'printk(KERN_INFO "Some blather with a %pK pointer in it",ptr) in irq
context, what we'll get (if we're lucky is:

Some blather with a <50-60 lines of WARN_ONCE output> pointer in it.

If we're unlucky? Well... 


[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]

  parent reply	other threads:[~2010-12-22 21:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22 17:00 [PATCH v5] kptr_restrict for hiding kernel pointers Dan Rosenberg
2010-12-22 17:13 ` Ingo Molnar
2010-12-22 17:17   ` Dan Rosenberg
2010-12-22 17:19     ` Dan Rosenberg
2010-12-22 21:43     ` Valdis.Kletnieks [this message]
2010-12-22 17:35   ` Dan Rosenberg
2010-12-22 21:26     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34753.1293054216@localhost \
    --to=valdis.kletnieks@vt.edu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=drosenberg@vsecurity.com \
    --cc=eparis@parisplace.org \
    --cc=eric.dumazet@gmail.com \
    --cc=eugeneteo@kernel.org \
    --cc=jmorris@namei.org \
    --cc=kees.cook@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).