From: Michael Ellerman <mpe@ellerman.id.au>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
schwab@linux-m68k.org, palmer@dabbelt.com,
linux-riscv@lists.infradead.org, guoren@kernel.org,
arnd@arndb.de
Subject: Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.1-4 tag
Date: Fri, 04 Nov 2022 09:18:54 +1100 [thread overview]
Message-ID: <87iljvsmup.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <CAHk-=wh87aGtg3eJPkA31V0Pn22hah0DWRc8oWsQ__5P2SXaTw@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> On Wed, Nov 2, 2022 at 7:09 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> - Fix an endian thinko in the asm-generic compat_arg_u64() which led to syscall arguments
>> being swapped for some compat syscalls.
>
> Am I mis-reading this, or did this bug (introduced in this merge
> window by commit 43d5de2b67d7 "asm-generic: compat: Support BE for
> long long args in 32-bit ABIs") break *every* architecture?
No. Just RISC-V and powerpc.
> And people just didn't scream, because 32-bit code has just become so rare?
I had two systems and several VMs that booted happily with the bug
present, so there's some luck involved as to whether your userspace
trips over the bug in a way that matters.
But we did have people scream eventually :/
> Or is it just because those compat macros are effectively not used
> elsewhere, and x86 has its own versions? Looks like possibly mainly
> RISC-V?
Yeah. Although compat_arg_u64() is defined for all arches, it's only
used in places guarded by __ARCH_WANT_COMPAT_FOO macros, and those are
only selected by RISC-V and powerpc.
Full list is:
__ARCH_WANT_COMPAT_FADVISE64_64 riscv
__ARCH_WANT_COMPAT_FALLOCATE riscv, powerpc
__ARCH_WANT_COMPAT_FTRUNCATE64 riscv
__ARCH_WANT_COMPAT_PREAD64 riscv
__ARCH_WANT_COMPAT_PWRITE64 riscv
__ARCH_WANT_COMPAT_READAHEAD riscv
__ARCH_WANT_COMPAT_SYNC_FILE_RANGE riscv
__ARCH_WANT_COMPAT_TRUNCATE64 riscv
> Side note: why is it doing
>
> #ifndef compat_arg_u64
>
> at all? That macro is not actually defined anywhere else, so that
> #ifdef seems to be just confused.
That goes back to the original submission:
59c10c52f573 ("riscv: compat: syscall: Add compat_sys_call_table implementation")
I guess it was following the example in asm-generic/compat.h where a
bunch of other things are guarded by ifndefs. But agree it's
unnecessarily flexible in this case until we have another definition.
cheers
next prev parent reply other threads:[~2022-11-03 22:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 2:09 [GIT PULL] Please pull powerpc/linux.git powerpc-6.1-4 tag Michael Ellerman
2022-11-03 17:44 ` Linus Torvalds
2022-11-03 22:18 ` Michael Ellerman [this message]
2022-11-03 18:31 ` pr-tracker-bot
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=87iljvsmup.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=arnd@arndb.de \
--cc=guoren@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=palmer@dabbelt.com \
--cc=schwab@linux-m68k.org \
--cc=torvalds@linux-foundation.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