lkml.org 
[lkml]   [2018]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] printk: Fix panic caused by passing log_buf_len to command line
On (09/19/18 10:27), He Zhe wrote:
> On 2018年09月19日 09:50, Sergey Senozhatsky wrote:
> > On (09/19/18 01:17), zhe.he@windriver.com wrote:
> >> @@ -1048,7 +1048,14 @@ static void __init log_buf_len_update(unsigned size)
> >> /* save requested log_buf_len since it's too early to process it */
> >> static int __init log_buf_len_setup(char *str)
> >> {
> >> - unsigned size = memparse(str, &str);
> >> + unsigned size;
> > unsigned int size;
>
> This is in v1 but then Steven suggested that it should be split out
> and only keep the pure fix part here.

Ah, I see.

Hmm... memparse() returns u64 value. A user *probably* can ask the kernel
to allocate log_buf larger than 'unsigned int'.

So may be I'd do two fixes here:

First - switch to u64 size.
Second - check for NULL str.


Steven, Petr, what do you think?

-ss

\
 
 \ /
  Last update: 2018-09-19 04:40    [W:0.125 / U:10.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site