Message ID | 87o7tossaa.fsf@mpe.ellerman.id.au (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [GIT,PULL] Please pull powerpc/linux.git powerpc-6.1-4 tag | expand |
Context | Check | Description |
---|---|---|
conchuod/apply | fail | Pull to for-next failed |
conchuod/tree_selection | success | Pull request for for-next |
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? And people just didn't scream, because 32-bit code has just become so rare? 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? 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. Linus
The pull request you sent on Thu, 03 Nov 2022 13:09:17 +1100:
> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-6.1-4
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/4d74039149e0062e4ed25738d6e3e06970a38809
Thank you!
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