lkml.org 
[lkml]   [2012]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] pstore/ram: fix undefined usage of rounddown_pow_of_two(0)
On Mon, Oct 22, 2012 at 08:17:27AM -0700, Kees Cook wrote:
> On Mon, Oct 22, 2012 at 2:19 AM, Florian Fainelli <ffainelli@freebox.fr> wrote:
> > From: Maxime Bizon <mbizon@freebox.fr>
> >
> > record_size / console_size / ftrace_size can be 0 (this is how you
> > disable the feature), but rounddown_pow_of_two(0) is undefined. As suggested
> > by Kees Cook, use !is_power_of_2() as a condition to call rounddown_pow_of_two
> > and avoid its undefined behavior on the value 0. This issue has been present
> > since commit 1894a253 (ramoops: Move to fs/pstore/ram.c).
> >
> > CC: stable@vger.kernel.org
> > Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
> > Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
>
> Thanks for the fix!
>
> Acked-by: Kees Cook <keescook@chromium.org>

Applied, thanks!


\
 
 \ /
  Last update: 2012-11-18 03:21    [W:0.047 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site