Re: [PATCH v6 9/9] vsprintf: Avoid confusion between invalid address and value

2019-02-20 Thread Sergey Senozhatsky
On (02/20/19 10:24), Petr Mladek wrote: > Well, better be on the safe side. I'll move it at the beginning > of the patchset. > > PS: I am a bit busy with some other things. I'll send v7 later. If this is the only change you are going to make then I'm OK with v6. -ss

Re: [PATCH v6 9/9] vsprintf: Avoid confusion between invalid address and value

2019-02-20 Thread Petr Mladek
On Tue 2019-02-19 13:06:17, Andy Shevchenko wrote: > On Tue, Feb 19, 2019 at 5:07 AM Sergey Senozhatsky > wrote: > > > Suppose, in my driver I want to sprintf() IPv4 address. The longest > > possible address is 3 * 4 (%d%d%d) + 3 bytes (dots) + terminating NULL. > > E.g. 111.111.111.111 > > > > f

Re: [PATCH v6 9/9] vsprintf: Avoid confusion between invalid address and value

2019-02-19 Thread Andy Shevchenko
On Tue, Feb 19, 2019 at 5:07 AM Sergey Senozhatsky wrote: > Suppose, in my driver I want to sprintf() IPv4 address. The longest > possible address is 3 * 4 (%d%d%d) + 3 bytes (dots) + terminating NULL. > E.g. 111.111.111.111 > > So I can allocate a 16-bytes buffer (stack or slab) and accidentally

Re: [PATCH v6 9/9] vsprintf: Avoid confusion between invalid address and value

2019-02-18 Thread Sergey Senozhatsky
On (02/08/19 16:23), Petr Mladek wrote: [..] > Plain Pointers > -- > diff --git a/lib/vsprintf.c b/lib/vsprintf.c > index 3a95b4d1ca2e..e51cbc2be540 100644 > --- a/lib/vsprintf.c > +++ b/lib/vsprintf.c > @@ -1510,7 +1510,7 @@ char *ip_addr_string(char *buf, char *end, const void > *p

Re: [PATCH v6 9/9] vsprintf: Avoid confusion between invalid address and value

2019-02-14 Thread Andy Shevchenko
On Thu, Feb 14, 2019 at 09:42:56AM +0100, Petr Mladek wrote: > On Wed 2019-02-13 15:54:55, Andy Shevchenko wrote: > > On Tue, Feb 12, 2019 at 04:45:30PM +0100, Petr Mladek wrote: > > > On Fri 2019-02-08 19:27:17, Andy Shevchenko wrote: > > > > On Fri, Feb 08, 2019 at 04:23:10PM +0100, Petr Mladek w

Re: [PATCH v6 9/9] vsprintf: Avoid confusion between invalid address and value

2019-02-14 Thread Petr Mladek
On Wed 2019-02-13 15:54:55, Andy Shevchenko wrote: > On Tue, Feb 12, 2019 at 04:45:30PM +0100, Petr Mladek wrote: > > On Fri 2019-02-08 19:27:17, Andy Shevchenko wrote: > > > On Fri, Feb 08, 2019 at 04:23:10PM +0100, Petr Mladek wrote: > > > > We are able to detect invalid values handled by %p[iI]

Re: [PATCH v6 9/9] vsprintf: Avoid confusion between invalid address and value

2019-02-13 Thread Andy Shevchenko
On Tue, Feb 12, 2019 at 04:45:30PM +0100, Petr Mladek wrote: > On Fri 2019-02-08 19:27:17, Andy Shevchenko wrote: > > On Fri, Feb 08, 2019 at 04:23:10PM +0100, Petr Mladek wrote: > > > We are able to detect invalid values handled by %p[iI] printk specifier. > > > The current error message is "inval

Re: [PATCH v6 9/9] vsprintf: Avoid confusion between invalid address and value

2019-02-12 Thread Petr Mladek
On Fri 2019-02-08 19:27:17, Andy Shevchenko wrote: > On Fri, Feb 08, 2019 at 04:23:10PM +0100, Petr Mladek wrote: > > We are able to detect invalid values handled by %p[iI] printk specifier. > > The current error message is "invalid address". It might cause confusion > > against "(efault)" reported

Re: [PATCH v6 9/9] vsprintf: Avoid confusion between invalid address and value

2019-02-08 Thread Andy Shevchenko
On Fri, Feb 08, 2019 at 04:23:10PM +0100, Petr Mladek wrote: > We are able to detect invalid values handled by %p[iI] printk specifier. > The current error message is "invalid address". It might cause confusion > against "(efault)" reported by the generic valid_pointer_address() check. > > Let's u