[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wiYUWaa676WN5hoyarKeKFDq3nfPg0haRRXeirtHyMg=A@mail.gmail.com>
Date: Sat, 18 Mar 2023 11:20:22 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
"HeungJun, Kim" <riverful.kim@...sung.com>,
Sylwester Nawrocki <s.nawrocki@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Mauro Carvalho Chehab <mchehab@...hat.com>
Cc: Kees Cook <keescook@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Jens Axboe <axboe@...nel.dk>,
Nathan Chancellor <nathan@...nel.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
clang-built-linux <llvm@...ts.linux.dev>,
linux-hardening@...r.kernel.org
Subject: Re: [GIT PULL] Block fixes for 6.3-rc3
On Fri, Mar 17, 2023 at 1:51 PM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> I do think that on the kernel side, the fix is to just change
>
> } while (type++ != SIZE_DEFAULT_FFMT);
>
> to
>
> } while (++type != SIZE_DEFAULT_FFMT);
Ok, I ended up deciding to just commit that minimal change, even
though it might have been better to just make it a normal for-loop
(and use M5MOLS_RESTYPE_MAX instead as the end condition).
So maybe it would be more legible (and less likely to have had that
off-by-one) if the loop had been
for (type = 0; type < M5MOLS_RESTYPE_MAX; type++)
instead. But I'll leave that decision to the driver authors (now cc'd).
For people brought in late, this is now commit efbcbb12ee99 ("media:
m5mols: fix off-by-one loop termination error") with link to the
discussion here
https://lore.kernel.org/linux-block/CAHk-=wgTSdKYbmB1JYM5vmHMcD9J9UZr0mn7BOYM_LudrP+Xvw@mail.gmail.com/
so you can see the history of it (me having initially blamed UBSAN,
but the problem can be triggered at least in theory without it).
Linus
Powered by blists - more mailing lists