* Re: [GIT PULL] Block fixes for 6.3-rc3
[not found] ` <CAHk-=wgTSdKYbmB1JYM5vmHMcD9J9UZr0mn7BOYM_LudrP+Xvw@mail.gmail.com>
@ 2023-03-19 0:48 ` Mauro Carvalho Chehab
0 siblings, 0 replies; only message in thread
From: Mauro Carvalho Chehab @ 2023-03-19 0:48 UTC (permalink / raw)
To: Linus Torvalds
Cc: Miguel Ojeda, Kees Cook, Nick Desaulniers, Jens Axboe,
Nathan Chancellor, linux-block@vger.kernel.org, clang-built-linux,
linux-hardening, Sylwester Nawrocki, Marek Szyprowski,
Sakari Ailus, linux-media
Em Fri, 17 Mar 2023 13:51:17 -0700
Linus Torvalds <torvalds@linux-foundation.org> escreveu:
> On Fri, Mar 17, 2023 at 1:42 PM Miguel Ojeda
> <miguel.ojeda.sandonis@gmail.com> wrote:
> >
> > It is comparing against just the `.code` in the `m5mols_default_ffmt`
> > table, i.e. the `MEDIA_BUS_FMT_VYUY8_2X8` (8199 = 0x2007) and
> > `MEDIA_BUS_FMT_JPEG_1X8` (16385 = 0x4001), see
>
> Yeah, I see what it's doing.
>
> But:
>
> > If the condition had `++type` instead, it would not be a problem,
> > because the loop stops before we go into the out of bounds access thus
> > no UB.
>
> Yeah, but clang really should have generated a proper third iteration,
> which calls that "out of bounds" case, and then returns, instead fo
> falling off the end.
>
> 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);
Yeah, that seems to be the right fix to me too.
Ack on such change:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=efbcbb12ee99f750c9f25c873b55ad774871de2a
Regards,
Mauro
>
> but I would *really* like clang to be fixed to not silently generate
> code that does insane things and would be basically impossible to
> debug if it ever triggers.
>
> We would have spent a *lot* of time wondering how the heck we Oopsed
> in m5mols_get_frame_desc().
>
> Linus
>
Thanks,
Mauro
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-19 0:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <9d0ef355-f430-e8e2-c844-b34cfcf60d88@kernel.dk>
[not found] ` <CAHk-=wgcYvgJ5YWJPy6PA-B_yRtPfpw01fmCqtvqGN9jouc_8w@mail.gmail.com>
[not found] ` <CAKwvOdmJkQUe6bhvQXHo0XOncdso0Kk26n8vdJZufm4Ku72tng@mail.gmail.com>
[not found] ` <6414c470.a70a0220.6b62f.3f02@mx.google.com>
[not found] ` <CAHk-=wi5yk0+NeqB34fRC-Zvt+8QZVPTiny9MvCxxjg+ZqDhKg@mail.gmail.com>
[not found] ` <CANiq72m46OzQPtZbS_VaQGgGknFV-hKvhBw8sVZx9ef=AzupTQ@mail.gmail.com>
[not found] ` <CAHk-=wgTSdKYbmB1JYM5vmHMcD9J9UZr0mn7BOYM_LudrP+Xvw@mail.gmail.com>
2023-03-19 0:48 ` [GIT PULL] Block fixes for 6.3-rc3 Mauro Carvalho Chehab
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).