stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Kees Cook <keescook@chromium.org>,
	Josef Bacik <josef@toxicpanda.com>, Jens Axboe <axboe@kernel.dk>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sasha Levin <sashal@kernel.org>,
	llvm@lists.linux.dev, stable <stable@vger.kernel.org>,
	Arnd Bergmann <arnd@kernel.org>,
	Naresh Kamboju <naresh.kamboju@linaro.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH 5.10] overflow.h: use new generic division helpers to avoid / operator
Date: Tue, 14 Sep 2021 12:57:42 -0700	[thread overview]
Message-ID: <CAHk-=whmcqmpPJQrAw4vX-Z6ePjeydjw7s6tzqzvB=uBp0=6fw@mail.gmail.com> (raw)
In-Reply-To: <CAKwvOdk9yqEMLTAxgZNmHgRSww0AnJ-x9qd7HK3v2Vepi1BdLw@mail.gmail.com>

On Tue, Sep 14, 2021 at 12:50 PM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> Just making sure __ffs() works as expected should blksize > LONG_MAX
> on 32b targets.  I don't see the range check you're referring to.
> loff_t is a long long, yeah?

Christ Nick.

Stop wasting my time.

Read the patch:

        if (!blksize)
-               blksize = NBD_DEF_BLKSIZE;
+               blksize = 1u << NBD_DEF_BLKSIZE_BITS;
        if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize))
                return -EINVAL;

        nbd->config->bytesize = bytesize;
-       nbd->config->blksize = blksize;
+       nbd->config->blksize_bits = __ffs(blksize);

See that range check?

Seriously, I've now replied several times to you just because you were
too damn lazy to just look three lines up from the __ffs() that you
reacted to, when I explicitly mentioned the range check several times,
including in the original submission, and when it was RIGHT THERE IN
THE PATCH IN THE ONLY PLACE THAT DID THAT __FFS.

(Ok, so the lower check of range was 512, not 1024, sue me).

It was all there in the diff all the time.

Don't email me again about this. At least not without spending the
FIVE SECONDS to look at what the hell you are emailing me about.

           Linus

  reply	other threads:[~2021-09-14 19:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 20:32 [PATCH 5.10] overflow.h: use new generic division helpers to avoid / operator Nick Desaulniers
2021-09-13 21:05 ` Rasmus Villemoes
2021-09-14  0:23   ` [PATCH v2] " Nick Desaulniers
2021-09-14 17:22     ` Greg Kroah-Hartman
2021-09-14 18:07       ` Nick Desaulniers
2021-09-14 18:12         ` Greg Kroah-Hartman
2021-09-14 17:32   ` [PATCH 5.10] " Kees Cook
2021-09-14 18:14     ` Linus Torvalds
2021-09-14 18:30       ` Linus Torvalds
2021-09-14 18:44         ` Nick Desaulniers
2021-09-14 18:48           ` Linus Torvalds
2021-09-14 18:56             ` Linus Torvalds
2021-09-14 19:10               ` Nick Desaulniers
2021-09-14 19:45                 ` Linus Torvalds
2021-09-14 19:50                   ` Nick Desaulniers
2021-09-14 19:57                     ` Linus Torvalds [this message]
2021-09-14 18:47         ` Kees Cook
2021-09-14 18:54           ` Linus Torvalds
2021-09-14 19:12             ` Nick Desaulniers
2021-09-14 19:52               ` Linus Torvalds

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='CAHk-=whmcqmpPJQrAw4vX-Z6ePjeydjw7s6tzqzvB=uBp0=6fw@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=arnd@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=gregkh@linuxfoundation.org \
    --cc=josef@toxicpanda.com \
    --cc=keescook@chromium.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=llvm@lists.linux.dev \
    --cc=naresh.kamboju@linaro.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=pavel@ucw.cz \
    --cc=sashal@kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=stable@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;
as well as URLs for NNTP newsgroup(s).