Re: [PATCH v3] vsprintf: Check real user/group id for %pK

2013-10-09 Thread Ryan Mallon
On 10/10/13 09:33, Joe Perches wrote: > On Thu, 2013-10-10 at 09:25 +1100, Ryan Mallon wrote: > >> if (kptr_restrict && (in_irq() || in_serving_softirq() || >>in_nmi())) { >> >> Is making sure that you don't have kernel code doing something like this: >> >> ir

Re: [PATCH v3] vsprintf: Check real user/group id for %pK

2013-10-09 Thread Joe Perches
On Thu, 2013-10-10 at 09:25 +1100, Ryan Mallon wrote: > if (kptr_restrict && (in_irq() || in_serving_softirq() || > in_nmi())) { > > Is making sure that you don't have kernel code doing something like this: > > irqreturn_t some_irq_handler(int irq, void *d

Re: [PATCH v3] vsprintf: Check real user/group id for %pK

2013-10-09 Thread Ryan Mallon
On 10/10/13 09:14, Joe Perches wrote: > On Thu, 2013-10-10 at 09:04 +1100, Ryan Mallon wrote: >> On 10/10/13 09:00, Joe Perches wrote: > [] >>> Move the interrupt tests and pK-error printk >>> into case 1: >>> >>> It's the only case where CAP_SYSLOG needs to be >>> tested so it doesn't need to be a

Re: [PATCH v3] vsprintf: Check real user/group id for %pK

2013-10-09 Thread Joe Perches
On Thu, 2013-10-10 at 09:04 +1100, Ryan Mallon wrote: > On 10/10/13 09:00, Joe Perches wrote: [] > > Move the interrupt tests and pK-error printk > > into case 1: > > > > It's the only case where CAP_SYSLOG needs to be > > tested so it doesn't need to be above the switch. > > Like I said, I think

Re: [PATCH v3] vsprintf: Check real user/group id for %pK

2013-10-09 Thread Ryan Mallon
On 10/10/13 09:00, Joe Perches wrote: > On Thu, 2013-10-10 at 08:52 +1100, Ryan Mallon wrote: >> Some setuid binaries will allow reading of files which have read >> permission by the real user id. This is problematic with files which >> use %pK because the file access permission is checked at open(

Re: [PATCH v3] vsprintf: Check real user/group id for %pK

2013-10-09 Thread Joe Perches
On Thu, 2013-10-10 at 08:52 +1100, Ryan Mallon wrote: > Some setuid binaries will allow reading of files which have read > permission by the real user id. This is problematic with files which > use %pK because the file access permission is checked at open() time, > but the kptr_restrict setting is

[PATCH v3] vsprintf: Check real user/group id for %pK

2013-10-09 Thread Ryan Mallon
Some setuid binaries will allow reading of files which have read permission by the real user id. This is problematic with files which use %pK because the file access permission is checked at open() time, but the kptr_restrict setting is checked at read() time. If a setuid binary opens a %pK file as