[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jJhsQ+yGgNRd-sitsusGsuyTjc_Q3DcoSDg4Q=MnJ4agw@mail.gmail.com>
Date: Mon, 22 Oct 2012 08:17:27 -0700
From: Kees Cook <keescook@...omium.org>
To: Florian Fainelli <ffainelli@...ebox.fr>
Cc: cbouatmailru@...il.com, ccross@...roid.com, tony.luck@...el.com,
linux-kernel@...r.kernel.org, Maxime Bizon <mbizon@...ebox.fr>,
stable@...r.kernel.org
Subject: Re: [PATCH v2] pstore/ram: fix undefined usage of rounddown_pow_of_two(0)
On Mon, Oct 22, 2012 at 2:19 AM, Florian Fainelli <ffainelli@...ebox.fr> wrote:
> From: Maxime Bizon <mbizon@...ebox.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@...r.kernel.org
> Signed-off-by: Maxime Bizon <mbizon@...ebox.fr>
> Signed-off-by: Florian Fainelli <ffainelli@...ebox.fr>
Thanks for the fix!
Acked-by: Kees Cook <keescook@...omium.org>
-Kees
--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists