Re: [PATCH] printk: ringbuffer: Wrong data pointer when appending small string

2020-10-15 Thread Petr Mladek
On Wed 2020-10-14 19:50:54, Petr Mladek wrote: > data_realloc() returns wrong data pointer when the block is wrapped and > the size is not increased. It might happen when pr_cont() wants to > add only few characters and there is already a space for them because > of alignment. > > It might cause w

Re: [PATCH] printk: ringbuffer: Wrong data pointer when appending small string

2020-10-15 Thread John Ogness
On 2020-10-15, Sergey Senozhatsky wrote: >> diff --git a/kernel/printk/printk_ringbuffer.c >> b/kernel/printk/printk_ringbuffer.c >> index 2493348a1631..24a960a89aa8 100644 >> --- a/kernel/printk/printk_ringbuffer.c >> +++ b/kernel/printk/printk_ringbuffer.c >> @@ -1125,7 +1125,10 @@ static char

Re: [PATCH] printk: ringbuffer: Wrong data pointer when appending small string

2020-10-14 Thread Sergey Senozhatsky
On (20/10/14 19:50), Petr Mladek wrote: > diff --git a/kernel/printk/printk_ringbuffer.c > b/kernel/printk/printk_ringbuffer.c > index 2493348a1631..24a960a89aa8 100644 > --- a/kernel/printk/printk_ringbuffer.c > +++ b/kernel/printk/printk_ringbuffer.c > @@ -1125,7 +1125,10 @@ static char *data_re

[PATCH] printk: ringbuffer: Wrong data pointer when appending small string

2020-10-14 Thread Petr Mladek
data_realloc() returns wrong data pointer when the block is wrapped and the size is not increased. It might happen when pr_cont() wants to add only few characters and there is already a space for them because of alignment. It might cause writing outsite the buffer. It has been detected by LTP test