linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-kernel@vger.kernel.org, "Jens Axboe" <axboe@kernel.dk>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Toralf Förster" <toralf.foerster@gmx.de>,
	linux-mm@kvack.org
Subject: Re: [RFC PATCH 1/2] log2: handle LARGE input to __roundup_pow_of_two()
Date: Sun, 20 Dec 2020 21:23:20 +0000	[thread overview]
Message-ID: <20201220212320.GA15600@casper.infradead.org> (raw)
In-Reply-To: <20201220211037.1354-1-rdunlap@infradead.org>

On Sun, Dec 20, 2020 at 01:10:37PM -0800, Randy Dunlap wrote:
> UBSAN detected a 64-bit shift in log2.h:__roundup_pow_of_two():
>   UBSAN: shift-out-of-bounds in ./include/linux/log2.h:57:13
>   shift exponent 64 is too large for 64-bit type 'long unsigned int'
> 
> This is during a call from mm/readahead.c:ondemand_readahead(),
> get_init_ra_size(), where the 'size' parameter must have been
> extremely large (or "negative").

Actually, I think it was zero, which is the real bug that should be fixed.


  reply	other threads:[~2020-12-20 21:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20 21:10 [RFC PATCH 1/2] log2: handle LARGE input to __roundup_pow_of_two() Randy Dunlap
2020-12-20 21:23 ` Matthew Wilcox [this message]
2020-12-20 22:19   ` Randy Dunlap

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=20201220212320.GA15600@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rdunlap@infradead.org \
    --cc=toralf.foerster@gmx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).