From: Colin Ian King <colin.king@canonical.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-afs@lists.infradead.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] afs: use BIT_ULL for shifting to fix integer overflow
Date: Fri, 30 Aug 2019 15:06:52 +0100 [thread overview]
Message-ID: <0a5df84f-920f-d2aa-69d6-963b40142f1f@canonical.com> (raw)
In-Reply-To: <3079.1567173701@warthog.procyon.org.uk>
On 30/08/2019 15:01, David Howells wrote:
> Colin King <colin.king@canonical.com> wrote:
>
>> The expression 1 << nr_slots is evaluated with 32 bit integer arithmetic
>> and can overflow before it is widened.
>
> If it does, it's an error on the part of the caller. See the banner comment:
> 1 <= nr_slots <= 9.
Doh, totally missed that. My bad.
>
> And, in any case, if nr_slots >= 64, using BIT_ULL wouldn't help...
>
> David
>
prev parent reply other threads:[~2019-08-30 14:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-30 10:49 Colin King
2019-08-30 14:01 ` David Howells
2019-08-30 14:06 ` Colin Ian King [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=0a5df84f-920f-d2aa-69d6-963b40142f1f@canonical.com \
--to=colin.king@canonical.com \
--cc=dhowells@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®