From: Andrew Donnellan <ajd@linux.ibm.com>
To: Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org
Cc: "Jason A . Donenfeld" <Jason@zx2c4.com>
Subject: Re: [PATCH 1/2] powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs
Date: Wed, 12 Oct 2022 18:56:07 +1100 [thread overview]
Message-ID: <567aa00bf6f5d97ca5b5d818e841b01061e1d217.camel@linux.ibm.com> (raw)
In-Reply-To: <20221012035335.866440-1-npiggin@gmail.com>
On Wed, 2022-10-12 at 13:53 +1000, Nicholas Piggin wrote:
> powerpc 32-bit system call (and function) calling convention for 64-
> bit
> arguments requires the next available odd-pair (two sequential
> registers
> with the first being odd-numbered) from the standard register
> argument
> allocation.
>
> The first argument register is r3, so a 64-bit argument that appears
> at
> an even position in the argument list must skip a register (unless
> there
> were preceeding 64-bit arguments, which might throw things off). This
> requires non-standard compat definitions to deal with the holes in
> the
> argument register allocation.
>
> With pt_regs syscall wrappers which use a standard mapper to map
> pt_regs
> GPRs to function arguments, 32-bit kernels hit the same basic
> problem,
> the standard definitions don't cope with the unused argument
> registers.
>
> Fix this by having 32-bit kernels share those syscall definitions
> with
> compat.
>
> Thanks to Jason for spending a lot of time finding and bisecting this
> and
> developing a trivial reproducer. The perfect bug report.
>
> Reported-by: Jason A. Donenfeld <Jason@zx2c4.com>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
Fixes: 7e92e01b72452 ("powerpc: Provide syscall wrapper")
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
next prev parent reply other threads:[~2022-10-12 7:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 3:53 [PATCH 1/2] powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs Nicholas Piggin
2022-10-12 3:53 ` [PATCH 2/2] powerpc: move sync_file_range2 compat definition Nicholas Piggin
2022-10-12 10:21 ` Arnd Bergmann
2022-10-12 7:56 ` Andrew Donnellan [this message]
2022-10-12 10:15 ` [PATCH 1/2] powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs Arnd Bergmann
2022-10-14 23:21 ` (subset) " Michael Ellerman
2022-10-30 17:03 ` Andreas Schwab
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=567aa00bf6f5d97ca5b5d818e841b01061e1d217.camel@linux.ibm.com \
--to=ajd@linux.ibm.com \
--cc=Jason@zx2c4.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).