lkml.org 
[lkml]   [2016]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/4] printk/kdb: Handle more message headers
On Wed,  9 Nov 2016 13:41:29 +0100
Petr Mladek <pmladek@suse.com> wrote:

> diff --git a/include/linux/printk.h b/include/linux/printk.h
> index eac1af8502bb..a0859e169bc3 100644
> --- a/include/linux/printk.h
> +++ b/include/linux/printk.h
> @@ -31,6 +31,14 @@ static inline const char *printk_skip_level(const char *buffer)
> return buffer;
> }
>
> +static inline const char *printk_skip_headers(const char *buffer)
> +{
> + while (printk_get_level(buffer))
> + buffer = printk_skip_level(buffer);

Hmm, shouldn't there be a length passed in here. What happens if buffer
ends with a header. Can't this overflow?

-- Steve

> +
> + return buffer;
> +}
> +
> #define CONSOLE_EXT_LOG_MAX 8192
>

\
 
 \ /
  Last update: 2016-11-11 18:35    [W:0.445 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site