mbox series

[GIT,PULL] Please pull powerpc/linux.git powerpc-6.1-4 tag

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

Pull-request

https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-6.1-4

Checks

Context Check Description
conchuod/apply fail Pull to for-next failed
conchuod/tree_selection success Pull request for for-next

Message

Michael Ellerman Nov. 3, 2022, 2:09 a.m. UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Linus,

Please pull some more powerpc fixes for 6.1.

We had a few bad bugs on 32-bit and compat due to the introduction of syscall wrappers,
which caused syscall arguments to be handled incorrectly for some syscalls. I have at
least one report of it causing someone's root partition to fill up, presumably due to a
bad fallocate.

The asm-generic change affects RISC-V too, although Palmer didn't think there were likely
to be many compat users on RISC-V.

cheers


The following changes since commit 65722736c3baf29e02e964a09e85c9ef71c48e8d:

  powerpc/64s/interrupt: Fix clear of PACA_IRQS_HARD_DIS when returning to soft-masked context (2022-10-27 00:38:35 +1100)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-6.1-4

for you to fetch changes up to 02a771c9a68a9f08cce4ec5e324fb1bc4dce7202:

  powerpc/32: Select ARCH_SPLIT_ARG64 (2022-11-01 15:27:12 +1100)

- ------------------------------------------------------------------
powerpc fixes for 6.1 #4

 - Fix an endian thinko in the asm-generic compat_arg_u64() which led to syscall arguments
   being swapped for some compat syscalls.

 - Fix syscall wrapper handling of syscalls with 64-bit arguments on 32-bit kernels, which
   led to syscall arguments being misplaced.

 - A build fix for amdgpu on Book3E with AltiVec disabled.

Thanks to: Andreas Schwab, Christian Zigotzky, Arnd Bergmann.

- ------------------------------------------------------------------
Andreas Schwab (2):
      asm-generic: compat: fix compat_arg_u64() and compat_arg_u64_dual()
      powerpc/32: fix syscall wrappers with 64-bit arguments

Michael Ellerman (3):
      Merge tag 'v6.1-rc2' into fixes
      powerpc/64e: Fix amdgpu build on Book3E w/o AltiVec
      powerpc/32: Select ARCH_SPLIT_ARG64


 arch/powerpc/Kconfig                     |  3 ++-
 arch/powerpc/include/asm/syscalls.h      |  7 +++++++
 arch/powerpc/kernel/sys_ppc32.c          | 13 ++++++++++++-
 arch/powerpc/kernel/syscalls/syscall.tbl |  7 +++++--
 include/asm-generic/compat.h             |  2 +-
 5 files changed, 27 insertions(+), 5 deletions(-)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAmNjINoACgkQUevqPMjh
pYCh1A//cDma7NOr7AgBcSCDjifYW+k7zSDgo/kELK126zsWa1mEeBBMNqbLVbRM
PPYjZUT8wcAjfKRm1V50Y5AoLjk+Me0IyNswKmWJQGUvQgwTt67GI90Z5eR3NiDl
niIfJYCccV2dqL+8SvEAWqCnXK/ViVFeTQfqf11SahS4Ste+vHW91sFrnew7gHb9
2sChygEsGq03iOOaVjXy0NArcCKWonAkzoxGtlTp1EWzfXNg5ApiydLfonlxofQk
t6DE3EGHq6fKaFy+fyTuIuKsqbfn2ucQ/yTXPxtnNThOIxTqj8VjMmfYgbiyMWHG
LIZ36o5sOblL1eFFYed+Dokg89hI5lJm6CCwc9/8WeTddX9wEZnRylgF9wSelQ+9
6PZrdfK7IqWC3Ugu+mI+xl0VjUj9jEdDMZNeus65xC7+3qRabOTsQxIIHDk4lM7J
DNxfVU2NNjM4Qh1FEC0JSVMlabW3Xk72OFilKf/OKJCxPAQUccjrI146yd1Ygqsc
diwzE94nkEeggYH1uPSfDeFT4t5l+jL0pSdVhjrMcnJBwVI/PjsR47a2YnrFqKUz
FQAKAbr/tJOM9sTsqaiZmMGh2lcMW8/pKZOwZoaA6YIM14jkchzNIpOyb/GRop9w
zf2VsG5UU5C4paW8yZ0sj5YyC+Ts2breiZJFNZzCmPsZzAH8wg8=
=rvku
-----END PGP SIGNATURE-----

Comments

Linus Torvalds Nov. 3, 2022, 5:44 p.m. UTC | #1
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
pr-tracker-bot@kernel.org Nov. 3, 2022, 6:31 p.m. UTC | #2
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!
Michael Ellerman Nov. 3, 2022, 10:18 p.m. UTC | #3
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