From: Dave Martin <Dave.Martin@arm.com>
To: Pi-Hsun Shih <pihsun@chromium.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
open list <linux-kernel@vger.kernel.org>,
Dominik Brodowski <linux@dominikbrodowski.net>,
"moderated list:ARM64 PORT AARCH64 ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm64: Mirror arm for small unimplemented compat syscalls
Date: Thu, 3 Jan 2019 11:50:12 +0000 [thread overview]
Message-ID: <20190103114959.GA3529@e103592.cambridge.arm.com> (raw)
In-Reply-To: <20190103074550.217421-1-pihsun@chromium.org>
On Thu, Jan 03, 2019 at 03:45:47PM +0800, Pi-Hsun Shih wrote:
> For syscall number smaller than 0xf0000, arm calls sys_ni_syscall
> instead of arm_syscall in arch/arm/kernel/entry-common.S, which returns
> -ENOSYS instead of raising SIGILL. Mirror this behavior for compat
> syscalls in arm64.
>
> Fixes: 532826f3712b607 ("arm64: Mirror arm for unimplemented compat
> syscalls")
> Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
> ---
> arch/arm64/kernel/syscall.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
> index 8f3371415642ad..95fd8c7ec8a171 100644
> --- a/arch/arm64/kernel/syscall.c
> +++ b/arch/arm64/kernel/syscall.c
> @@ -21,7 +21,7 @@ asmlinkage long do_ni_syscall(struct pt_regs *regs)
> {
> #ifdef CONFIG_COMPAT
> long ret;
> - if (is_compat_task()) {
> + if (is_compat_task() && regs->regs[7] >= __ARM_NR_COMPAT_BASE) {
compat_arm_syscall() ignores all bits r7 except for bits [15:0].
So, doesn't this mean that 0xf0000, 0x100000, 0x110000 will all do the
same thing now? (Previously to your patch, 0xe0000, 0xd0000 etc. would
also match in this code I've misunderstood something.)
The gating check in arch/arm/kernel/trapc.s:arm_syscall() is
if ((no >> 16) != (__ARM_NR_BASE>> 16))
I would expect that arm64 needs a similar check somewhere. Is the check
already present? I may have missed it.
Cheers
---Dave
next prev parent reply other threads:[~2019-01-03 11:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 7:45 Pi-Hsun Shih
2019-01-03 11:50 ` Dave Martin [this message]
2019-01-03 16:51 ` Will Deacon
2019-01-03 17:52 ` Will Deacon
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=20190103114959.GA3529@e103592.cambridge.arm.com \
--to=dave.martin@arm.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=mark.rutland@arm.com \
--cc=pihsun@chromium.org \
--cc=will.deacon@arm.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
all inboxes | Powered by JetHome®