[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdkpsvNK2x+=S80crW0reFBH-vwuNop7-2mFayajFMcqog@mail.gmail.com>
Date: Mon, 13 Sep 2021 13:36:49 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Sedat Dilek <sedat.dilek@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Nathan Chancellor <natechancellor@...il.com>,
Baokun Li <libaokun1@...wei.com>,
open list <linux-kernel@...r.kernel.org>,
linux-stable <stable@...r.kernel.org>,
Hulk Robot <hulkci@...wei.com>,
Josef Bacik <josef@...icpanda.com>,
Jens Axboe <axboe@...nel.dk>, Sasha Levin <sashal@...nel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
lkft-triage@...ts.linaro.org, llvm@...ts.linux.dev,
Kees Cook <keescook@...omium.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Arnd Bergmann <arnd@...nel.org>
Subject: Re: [PATCH 5.14 018/334] nbd: add the check to prevent overflow in __nbd_ioctl()
On Mon, Sep 13, 2021 at 1:16 PM Nick Desaulniers
<ndesaulniers@...gle.com> wrote:
>
> On Mon, Sep 13, 2021 at 1:10 PM Linus Torvalds
> <torvalds@...ux-foundation.org> wrote:
> >
> > On Mon, Sep 13, 2021 at 1:02 PM Nick Desaulniers
> > <ndesaulniers@...gle.com> wrote:
> > >
> > > Ha! I pulled+rebased and this code disappeared...I thought I had
> > > rebased on the wrong branch or committed work to master accidentally.
> > > Patch to stable-only inbound.
> >
> > Side note: for stable, can you look into using _Generic() instead of
> > __builtin_choose_expression() with typeof, or some
> > __builtin_types_compatible_p() magic?
> >
> > Yes, yes, we use __builtin_choose_expression() elsewhere, but we've
> > started using _Generic(), and it's really the more natural model - in
> > addition to being the standard C one.
> >
> > Of course, there may be some reason why _Generic() doesn't work, but
> > it _is_ the natural fit for any "for type X, do Y" kind of thing.
> >
> > No?
>
> Man, c'mon, I just got the __builtin_choose_expression() working! It's
> not...too bad...ish. (Besides, I'd actually have to learn how to use
> _Generic...I've never quite gotten anything I've written trying to use
> it to actually compile).
>
> Do we have access to _Generic in GCC 4.9?
Follow up thread, sorry/not sorry for not taking the full cc list:
https://lore.kernel.org/stable/20210913203201.1844253-1-ndesaulniers@google.com/
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists