Re: [PATCH v6 8/9] vsprintf: Prevent crash when dereferencing invalid pointers

2019-02-20 Thread Petr Mladek
On Tue 2019-02-19 23:15:16, Sergey Senozhatsky wrote: > On (02/19/19 15:49), Andy Shevchenko wrote: > > > On (02/19/19 13:02), Andy Shevchenko wrote: > > > [..] > > > > And if it's not? You will get in either case incomplete information, > > > > but at least with "(e" (or even "(") you might get a

Re: [PATCH v6 8/9] vsprintf: Prevent crash when dereferencing invalid pointers

2019-02-19 Thread Sergey Senozhatsky
On (02/19/19 15:49), Andy Shevchenko wrote: > > On (02/19/19 13:02), Andy Shevchenko wrote: > > [..] > > > And if it's not? You will get in either case incomplete information, > > > but at least with "(e" (or even "(") you might get a clue that it > > > errornous conditions. > > > > The thing I'm

Re: [PATCH v6 8/9] vsprintf: Prevent crash when dereferencing invalid pointers

2019-02-19 Thread Andy Shevchenko
On Tue, Feb 19, 2019 at 09:51:15PM +0900, Sergey Senozhatsky wrote: > On (02/19/19 13:02), Andy Shevchenko wrote: > [..] > > And if it's not? You will get in either case incomplete information, > > but at least with "(e" (or even "(") you might get a clue that it > > errornous conditions. > > The

Re: [PATCH v6 8/9] vsprintf: Prevent crash when dereferencing invalid pointers

2019-02-19 Thread Sergey Senozhatsky
On (02/19/19 13:02), Andy Shevchenko wrote: [..] > And if it's not? You will get in either case incomplete information, > but at least with "(e" (or even "(") you might get a clue that it > errornous conditions. The thing I'm signaling here is that in some cases we still can crash the kernel; with

Re: [PATCH v6 8/9] vsprintf: Prevent crash when dereferencing invalid pointers

2019-02-19 Thread Andy Shevchenko
On Tue, Feb 19, 2019 at 5:35 AM Sergey Senozhatsky wrote: > On (02/08/19 16:23), Petr Mladek wrote: > Hmm... So the assumption here is that the target buffer always has > at least strlen("(efault)") bytes and, thus, we always can write the > error message to it. Same assumption as for pointers,

Re: [PATCH v6 8/9] vsprintf: Prevent crash when dereferencing invalid pointers

2019-02-18 Thread Sergey Senozhatsky
On (02/08/19 16:23), Petr Mladek wrote: [..] > + /* > + * This is not a fool-proof test. 99% of the time that this will fault is > + * due to a bad pointer, not one that crosses into bad memory. Just test > + * the address to make sure it doesn't fault due to a poorly added printk > + * during

[PATCH v6 8/9] vsprintf: Prevent crash when dereferencing invalid pointers

2019-02-08 Thread Petr Mladek
We already prevent crash when dereferencing some obviously broken pointers. But the handling is not consistent. Sometimes we print "(null)" only for pure NULL pointer, sometimes for pointers in the first page and sometimes also for pointers in the last page (error codes). Note that printk() call t