All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: Florian Fainelli <ffainelli@freebox.fr>,
	ccross@android.com, tony.luck@intel.com,
	linux-kernel@vger.kernel.org, Maxime Bizon <mbizon@freebox.fr>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] pstore/ram: fix undefined usage of rounddown_pow_of_two(0)
Date: Sat, 17 Nov 2012 17:42:12 -0800	[thread overview]
Message-ID: <20121118014212.GA5556@lizard.sbx05977.paloaca.wayport.net> (raw)
In-Reply-To: <CAGXu5jJhsQ+yGgNRd-sitsusGsuyTjc_Q3DcoSDg4Q=MnJ4agw@mail.gmail.com>

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!

      reply	other threads:[~2012-11-18  1:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 11:59 [PATCH] pstore/ram: fix undefined usage of rounddown_pow_of_two Florian Fainelli
2012-10-19 16:03 ` Kees Cook
2012-10-22  8:37   ` Florian Fainelli
2012-10-22  9:19 ` [PATCH v2] pstore/ram: fix undefined usage of rounddown_pow_of_two(0) Florian Fainelli
2012-10-22 15:17   ` Kees Cook
2012-11-18  1:42     ` Anton Vorontsov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121118014212.GA5556@lizard.sbx05977.paloaca.wayport.net \
    --to=cbouatmailru@gmail.com \
    --cc=ccross@android.com \
    --cc=ffainelli@freebox.fr \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbizon@freebox.fr \
    --cc=stable@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.