[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wikuhxhdSEgqb-Lkb2ibQM_hAHR1Cu7yxg-gHZu1NF+ug@mail.gmail.com>
Date: Wed, 26 Mar 2025 15:41:34 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Jann Horn <jannh@...gle.com>, Marco Elver <elver@...gle.com>,
Nathan Chancellor <nathan@...nel.org>, Linux-Arch <linux-arch@...r.kernel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rwonce: fix crash by removing READ_ONCE() for unaligned read
On Wed, 26 Mar 2025 at 14:24, Arnd Bergmann <arnd@...db.de> wrote:
>
> I've applied this on top of the asm-generic branch, but I just sent
> the pull request with the regression to Linus an hour ago.
>
> I'll try to get a new pull request out tomorrow.
I will ignore that pull request, and wait for your updated one.
That said, this whole thing worries me. The fact that the compiler
magically makes READ_ONCE() require alignment that it normally doesn't
require seems like a bug waiting to happen somewhere else.
Because I do think that we might want READ_ONCE() on unaligned data in
general. Should said places generally use "get_unaligned()"? Sure. And
are unaligned accesses potentially non-atomic anyway because of
hardware? Also sure.
But one reason for READ_ONCE() isn't for some kind of hardware
atomicity, it is to avoid any ToCToU issues due to compilers doing bad
things.
And then this seems to be a serious issue with the whole "READ_ONCE()
now requires alignment that it didn't require before".
Put another way: I wonder what other cases may lurk around this all...
Linus
Powered by blists - more mailing lists