Re: [PATCH v3] kptr_restrict for hiding kernel pointers

From: Valdis . Kletnieks
Date: Mon Dec 20 2010 - 17:29:08 EST


On Sat, 18 Dec 2010 12:20:34 EST, Dan Rosenberg said:

> @@ -1035,6 +1038,26 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
> return buf + vsnprintf(buf, end - buf,
> ((struct va_format *)ptr)->fmt,
> *(((struct va_format *)ptr)->va));
> + case 'K':
> + /*
> + * %pK cannot be used in IRQ context because it tests
> + * CAP_SYSLOG.
> + */
> + if (in_irq() || in_serving_softirq() || in_nmi())
> + WARN_ONCE(1, "%%pK used in interrupt context.\n");

Should this then continue on and test CAP_SYSLOG anyhow, or should it
return a "" or or "<invalid>" or something?

Attachment: pgp00000.pgp
Description: PGP signature