Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-16 Thread Tobin C. Harding
On Wed, Dec 06, 2017 at 07:19:24AM +0300, Alexey Dobriyan wrote: > > more %p grepping [filtering out all `%ps %pf %pb' variants] gives > > a huge number of print outs that potentially can be broken now > > Because people who introduce this stupid %p hashing can't be bothered > to actually audit

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-16 Thread Tobin C. Harding
On Wed, Dec 06, 2017 at 07:19:24AM +0300, Alexey Dobriyan wrote: > > more %p grepping [filtering out all `%ps %pf %pb' variants] gives > > a huge number of print outs that potentially can be broken now > > Because people who introduce this stupid %p hashing can't be bothered > to actually audit

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Sergey Senozhatsky
On (12/07/17 16:17), Tobin C. Harding wrote: [..] > > hm, indeed. and !CONFIG_KALLSYMS config turns %pS/%ps > > into special_hex_number(). > > But totally misses this :( > > "" would be better returned when !CONFIG_KALLSYMS, right? I guess I'll take back my comment. I assume there are tons of

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Sergey Senozhatsky
On (12/07/17 16:17), Tobin C. Harding wrote: [..] > > hm, indeed. and !CONFIG_KALLSYMS config turns %pS/%ps > > into special_hex_number(). > > But totally misses this :( > > "" would be better returned when !CONFIG_KALLSYMS, right? I guess I'll take back my comment. I assume there are tons of

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Tobin C. Harding
On Wed, Dec 06, 2017 at 05:45:37PM +0900, Sergey Senozhatsky wrote: > On (12/06/17 09:32), Geert Uytterhoeven wrote: > [..] > > >> show_fault_oops(struct pt_regs *regs, unsigned long error_code, > > >> unsigned long address) > > >> ... > > >> printk(KERN_CONT " at %p\n",

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Tobin C. Harding
On Wed, Dec 06, 2017 at 05:45:37PM +0900, Sergey Senozhatsky wrote: > On (12/06/17 09:32), Geert Uytterhoeven wrote: > [..] > > >> show_fault_oops(struct pt_regs *regs, unsigned long error_code, > > >> unsigned long address) > > >> ... > > >> printk(KERN_CONT " at %p\n",

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Tobin C. Harding
On Wed, Dec 06, 2017 at 09:32:14AM +0100, Geert Uytterhoeven wrote: > Hi Linus, > > On Wed, Dec 6, 2017 at 2:59 AM, Linus Torvalds > wrote: > > On Tue, Dec 5, 2017 at 5:36 PM, Sergey Senozhatsky > > wrote: > >> I see some %p-s

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Tobin C. Harding
On Wed, Dec 06, 2017 at 09:32:14AM +0100, Geert Uytterhoeven wrote: > Hi Linus, > > On Wed, Dec 6, 2017 at 2:59 AM, Linus Torvalds > wrote: > > On Tue, Dec 5, 2017 at 5:36 PM, Sergey Senozhatsky > > wrote: > >> I see some %p-s being used in _supposedly_ important output, > >> like

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Sergey Senozhatsky
On (12/06/17 09:32), Geert Uytterhoeven wrote: [..] > >> show_fault_oops(struct pt_regs *regs, unsigned long error_code, > >> unsigned long address) > >> ... > >> printk(KERN_CONT " at %p\n", (void *) address); > >> printk(KERN_ALERT "IP: %pS\n", (void *)regs->ip);

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Sergey Senozhatsky
On (12/06/17 09:32), Geert Uytterhoeven wrote: [..] > >> show_fault_oops(struct pt_regs *regs, unsigned long error_code, > >> unsigned long address) > >> ... > >> printk(KERN_CONT " at %p\n", (void *) address); > >> printk(KERN_ALERT "IP: %pS\n", (void *)regs->ip);

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Geert Uytterhoeven
Hi Linus, On Wed, Dec 6, 2017 at 2:59 AM, Linus Torvalds wrote: > On Tue, Dec 5, 2017 at 5:36 PM, Sergey Senozhatsky > wrote: >> I see some %p-s being used in _supposedly_ important output, >> like arch/x86/mm/fault.c >> >>

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-06 Thread Geert Uytterhoeven
Hi Linus, On Wed, Dec 6, 2017 at 2:59 AM, Linus Torvalds wrote: > On Tue, Dec 5, 2017 at 5:36 PM, Sergey Senozhatsky > wrote: >> I see some %p-s being used in _supposedly_ important output, >> like arch/x86/mm/fault.c >> >> show_fault_oops(struct pt_regs *regs, unsigned long error_code, >>

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Linus Torvalds
On Tue, Dec 5, 2017 at 8:19 PM, Alexey Dobriyan wrote: > Because people who introduce this stupid %p hashing can't be bothered > to actually audit users: I don't see you having offered to audit the 12k+ cases, did you? So maybe it's easier to just change them all, and then

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Linus Torvalds
On Tue, Dec 5, 2017 at 8:19 PM, Alexey Dobriyan wrote: > Because people who introduce this stupid %p hashing can't be bothered > to actually audit users: I don't see you having offered to audit the 12k+ cases, did you? So maybe it's easier to just change them all, and then the handful that

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Alexey Dobriyan
> more %p grepping [filtering out all `%ps %pf %pb' variants] gives > a huge number of print outs that potentially can be broken now Because people who introduce this stupid %p hashing can't be bothered to actually audit users: static int show_timer(struct seq_file *m, void *v) {

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Alexey Dobriyan
> more %p grepping [filtering out all `%ps %pf %pb' variants] gives > a huge number of print outs that potentially can be broken now Because people who introduce this stupid %p hashing can't be bothered to actually audit users: static int show_timer(struct seq_file *m, void *v) {

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Sergey Senozhatsky
On (12/05/17 17:59), Linus Torvalds wrote: [..] > On Tue, Dec 5, 2017 at 5:36 PM, Sergey Senozhatsky > wrote: > > I see some %p-s being used in _supposedly_ important output, > > like arch/x86/mm/fault.c > > > > show_fault_oops(struct pt_regs *regs, unsigned

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Sergey Senozhatsky
On (12/05/17 17:59), Linus Torvalds wrote: [..] > On Tue, Dec 5, 2017 at 5:36 PM, Sergey Senozhatsky > wrote: > > I see some %p-s being used in _supposedly_ important output, > > like arch/x86/mm/fault.c > > > > show_fault_oops(struct pt_regs *regs, unsigned long error_code, > >

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Linus Torvalds
On Tue, Dec 5, 2017 at 5:36 PM, Sergey Senozhatsky wrote: > I see some %p-s being used in _supposedly_ important output, > like arch/x86/mm/fault.c > > show_fault_oops(struct pt_regs *regs, unsigned long error_code, > unsigned long address) > ...

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Linus Torvalds
On Tue, Dec 5, 2017 at 5:36 PM, Sergey Senozhatsky wrote: > I see some %p-s being used in _supposedly_ important output, > like arch/x86/mm/fault.c > > show_fault_oops(struct pt_regs *regs, unsigned long error_code, > unsigned long address) > ... > printk(KERN_CONT " at

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Sergey Senozhatsky
Hello, On (12/05/17 13:22), Linus Torvalds wrote: [..] > It's not like those hex numbers were really helping people anyway. > We've turned off most of them on x86 oops reports long ago (and > entirely independently of the pointer hashing). Having stared at a lot > of oopses in my time, the only

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Sergey Senozhatsky
Hello, On (12/05/17 13:22), Linus Torvalds wrote: [..] > It's not like those hex numbers were really helping people anyway. > We've turned off most of them on x86 oops reports long ago (and > entirely independently of the pointer hashing). Having stared at a lot > of oopses in my time, the only

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Linus Torvalds
On Tue, Dec 5, 2017 at 1:08 PM, Randy Dunlap wrote: > > This kind of option (with default hashed) is what I was just thinking of > after having seen a few unhelpful traces. But then the knob might not be > changed in time for the traces either. :( .. I really dislike the

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Linus Torvalds
On Tue, Dec 5, 2017 at 1:08 PM, Randy Dunlap wrote: > > This kind of option (with default hashed) is what I was just thinking of > after having seen a few unhelpful traces. But then the knob might not be > changed in time for the traces either. :( .. I really dislike the idea of such a knob.

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Randy Dunlap
On 11/30/2017 02:38 AM, David Laight wrote: > From: Kees Cook >> Sent: 29 November 2017 22:28 >> On Wed, Nov 29, 2017 at 2:07 AM, David Laight >> wrote: >>> From: Linus Torvalds Sent: 29 November 2017 02:29 On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-12-05 Thread Randy Dunlap
On 11/30/2017 02:38 AM, David Laight wrote: > From: Kees Cook >> Sent: 29 November 2017 22:28 >> On Wed, Nov 29, 2017 at 2:07 AM, David Laight >> wrote: >>> From: Linus Torvalds Sent: 29 November 2017 02:29 On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: > >

RE: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-30 Thread David Laight
From: Kees Cook > Sent: 29 November 2017 22:28 > On Wed, Nov 29, 2017 at 2:07 AM, David Laight wrote: > > From: Linus Torvalds > >> Sent: 29 November 2017 02:29 > >> > >> On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: > >> > > >> >Let's add

RE: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-30 Thread David Laight
From: Kees Cook > Sent: 29 November 2017 22:28 > On Wed, Nov 29, 2017 at 2:07 AM, David Laight wrote: > > From: Linus Torvalds > >> Sent: 29 November 2017 02:29 > >> > >> On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: > >> > > >> >Let's add specifier %px as a > >> > clear, opt-in,

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Tobin C. Harding
On Wed, Nov 29, 2017 at 08:41:36PM -0800, Joe Perches wrote: > On Thu, 2017-11-30 at 15:18 +1100, Tobin C. Harding wrote: > > On Wed, Nov 29, 2017 at 07:58:26PM -0800, Joe Perches wrote: > > > On Thu, 2017-11-30 at 10:26 +1100, Tobin C. Harding wrote: > > > > On Wed, Nov 29, 2017 at 03:20:58PM

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Tobin C. Harding
On Wed, Nov 29, 2017 at 08:41:36PM -0800, Joe Perches wrote: > On Thu, 2017-11-30 at 15:18 +1100, Tobin C. Harding wrote: > > On Wed, Nov 29, 2017 at 07:58:26PM -0800, Joe Perches wrote: > > > On Thu, 2017-11-30 at 10:26 +1100, Tobin C. Harding wrote: > > > > On Wed, Nov 29, 2017 at 03:20:58PM

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Joe Perches
On Thu, 2017-11-30 at 15:18 +1100, Tobin C. Harding wrote: > On Wed, Nov 29, 2017 at 07:58:26PM -0800, Joe Perches wrote: > > On Thu, 2017-11-30 at 10:26 +1100, Tobin C. Harding wrote: > > > On Wed, Nov 29, 2017 at 03:20:58PM -0800, Andrew Morton wrote: > > > > On Wed, 29 Nov 2017 13:05:04 +1100

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Joe Perches
On Thu, 2017-11-30 at 15:18 +1100, Tobin C. Harding wrote: > On Wed, Nov 29, 2017 at 07:58:26PM -0800, Joe Perches wrote: > > On Thu, 2017-11-30 at 10:26 +1100, Tobin C. Harding wrote: > > > On Wed, Nov 29, 2017 at 03:20:58PM -0800, Andrew Morton wrote: > > > > On Wed, 29 Nov 2017 13:05:04 +1100

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Tobin C. Harding
On Wed, Nov 29, 2017 at 07:58:26PM -0800, Joe Perches wrote: > On Thu, 2017-11-30 at 10:26 +1100, Tobin C. Harding wrote: > > On Wed, Nov 29, 2017 at 03:20:58PM -0800, Andrew Morton wrote: > > > On Wed, 29 Nov 2017 13:05:04 +1100 "Tobin C. Harding" > > > wrote: > > > > > > >

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Tobin C. Harding
On Wed, Nov 29, 2017 at 07:58:26PM -0800, Joe Perches wrote: > On Thu, 2017-11-30 at 10:26 +1100, Tobin C. Harding wrote: > > On Wed, Nov 29, 2017 at 03:20:58PM -0800, Andrew Morton wrote: > > > On Wed, 29 Nov 2017 13:05:04 +1100 "Tobin C. Harding" > > > wrote: > > > > > > > printk specifier %p

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Joe Perches
On Thu, 2017-11-30 at 10:26 +1100, Tobin C. Harding wrote: > On Wed, Nov 29, 2017 at 03:20:58PM -0800, Andrew Morton wrote: > > On Wed, 29 Nov 2017 13:05:04 +1100 "Tobin C. Harding" wrote: > > > > > printk specifier %p now hashes all addresses before printing. Sometimes > > > we

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Joe Perches
On Thu, 2017-11-30 at 10:26 +1100, Tobin C. Harding wrote: > On Wed, Nov 29, 2017 at 03:20:58PM -0800, Andrew Morton wrote: > > On Wed, 29 Nov 2017 13:05:04 +1100 "Tobin C. Harding" wrote: > > > > > printk specifier %p now hashes all addresses before printing. Sometimes > > > we need to see the

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Tobin C. Harding
On Wed, Nov 29, 2017 at 03:20:58PM -0800, Andrew Morton wrote: > On Wed, 29 Nov 2017 13:05:04 +1100 "Tobin C. Harding" wrote: > > > printk specifier %p now hashes all addresses before printing. Sometimes > > we need to see the actual unmodified address. This can be achieved using

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Tobin C. Harding
On Wed, Nov 29, 2017 at 03:20:58PM -0800, Andrew Morton wrote: > On Wed, 29 Nov 2017 13:05:04 +1100 "Tobin C. Harding" wrote: > > > printk specifier %p now hashes all addresses before printing. Sometimes > > we need to see the actual unmodified address. This can be achieved using > > %lx but

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Andrew Morton
On Wed, 29 Nov 2017 13:05:04 +1100 "Tobin C. Harding" wrote: > printk specifier %p now hashes all addresses before printing. Sometimes > we need to see the actual unmodified address. This can be achieved using > %lx but then we face the risk that if in future we want to change the

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Andrew Morton
On Wed, 29 Nov 2017 13:05:04 +1100 "Tobin C. Harding" wrote: > printk specifier %p now hashes all addresses before printing. Sometimes > we need to see the actual unmodified address. This can be achieved using > %lx but then we face the risk that if in future we want to change the > way the

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Linus Torvalds
On Wed, Nov 29, 2017 at 2:28 PM, Kees Cook wrote: > > In the future, maybe we could have a knob: unhashed, hashed (default), > or zeroed. I haven't actually seen a case for that yet. Let's see if there are actually any debug issues at all, and how big they are before

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Linus Torvalds
On Wed, Nov 29, 2017 at 2:28 PM, Kees Cook wrote: > > In the future, maybe we could have a knob: unhashed, hashed (default), > or zeroed. I haven't actually seen a case for that yet. Let's see if there are actually any debug issues at all, and how big they are before worrying about it.

RE: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Roberts, William C
.com>; Djalal Harouni <tix...@gmail.com>; Radim > Krcmár <rkrc...@redhat.com>; Linux Kernel Mailing List ker...@vger.kernel.org>; Network Development <net...@vger.kernel.org>; > David Miller <da...@davemloft.net>; Stephen Rothwell > <s...@canb.auug.org.au>

RE: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Roberts, William C
Daniel > Micay ; Djalal Harouni ; Radim > Krcmár ; Linux Kernel Mailing List ker...@vger.kernel.org>; Network Development ; > David Miller ; Stephen Rothwell > ; Andrey Ryabinin ; > Alexander Potapenko ; Dmitry Vyukov > ; Andrew Morton > Subject: Re: [PATCH V11 4/5] vsprin

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Kees Cook
On Wed, Nov 29, 2017 at 2:07 AM, David Laight wrote: > From: Linus Torvalds >> Sent: 29 November 2017 02:29 >> >> On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: >> > >> >Let's add specifier %px as a >> > clear, opt-in, way to print a pointer

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread Kees Cook
On Wed, Nov 29, 2017 at 2:07 AM, David Laight wrote: > From: Linus Torvalds >> Sent: 29 November 2017 02:29 >> >> On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: >> > >> >Let's add specifier %px as a >> > clear, opt-in, way to print a pointer and maintain some level of >> >

RE: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread David Laight
From: Linus Torvalds > Sent: 29 November 2017 02:29 > > On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: > > > >Let's add specifier %px as a > > clear, opt-in, way to print a pointer and maintain some level of > > isolation from all the other hex integer output within

RE: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-29 Thread David Laight
From: Linus Torvalds > Sent: 29 November 2017 02:29 > > On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: > > > >Let's add specifier %px as a > > clear, opt-in, way to print a pointer and maintain some level of > > isolation from all the other hex integer output within the Kernel. >

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-28 Thread Tobin C. Harding
On Tue, Nov 28, 2017 at 06:29:02PM -0800, Linus Torvalds wrote: > On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: > > > >Let's add specifier %px as a > > clear, opt-in, way to print a pointer and maintain some level of > > isolation from all the other hex integer

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-28 Thread Tobin C. Harding
On Tue, Nov 28, 2017 at 06:29:02PM -0800, Linus Torvalds wrote: > On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: > > > >Let's add specifier %px as a > > clear, opt-in, way to print a pointer and maintain some level of > > isolation from all the other hex integer output within the

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-28 Thread Linus Torvalds
On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: > >Let's add specifier %px as a > clear, opt-in, way to print a pointer and maintain some level of > isolation from all the other hex integer output within the Kernel. Yes, I like this model. It's easy and it's obvious

Re: [PATCH V11 4/5] vsprintf: add printk specifier %px

2017-11-28 Thread Linus Torvalds
On Tue, Nov 28, 2017 at 6:05 PM, Tobin C. Harding wrote: > >Let's add specifier %px as a > clear, opt-in, way to print a pointer and maintain some level of > isolation from all the other hex integer output within the Kernel. Yes, I like this model. It's easy and it's obvious ("'x' for hex"),