mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: "keescook@chromium.org" <keescook@chromium.org>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	"dsaxena@linaro.org" <dsaxena@linaro.org>,
	"arndb@arndb.de" <arndb@arndb.de>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8 2/6] arm64: ptrace: allow tracer to skip a system call
Date: Tue, 25 Nov 2014 13:56:26 +0000	[thread overview]
Message-ID: <20141125135626.GB8541@arm.com> (raw)
In-Reply-To: <546D81A2.4040405@linaro.org>

On Thu, Nov 20, 2014 at 05:52:34AM +0000, AKASHI Takahiro wrote:
> On 11/20/2014 02:13 PM, AKASHI Takahiro wrote:
> > On 11/20/2014 04:06 AM, Will Deacon wrote:
> >> Ok, but now userspace sees -ENOSYS for a skipped system call in that case,
> >> whereas it would usually see whatever the trace put in x0, right?
> >
> > Yes.
> > If you don't really like this behavior, how about this patch instead of my [2/6] patch?
> >
> > diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> > index 726b910..1ef57d0 100644
> > --- a/arch/arm64/kernel/entry.S
> > +++ b/arch/arm64/kernel/entry.S
> > @@ -668,8 +668,15 @@ ENDPROC(el0_svc)
> >           * switches, and waiting for our parent to respond.
> >           */
> >   __sys_trace:
> > +       cmp     w8, #-1                         // default errno for invalid
> 
> I needed to correct the code here:
> w8 should be w26, thinking of compat syscalls.
> 
> > +       b.ne    1f                              // system call
> > +       mov     x0, #-ENOSYS
> > +       str     x0, [sp, #S_X0]
> > +1:
> 
> and this part might better be generalized like the following:
> 
> __sys_trace:
> 	cmp	w26, w25	// cannot use x26 and x25 here
> 	b.hs	1f		// scno > sc_nr || scno < 0
> 	b	2f
> 1:
> 	mov	x0, #-ENOSYS
> 	str	x0, [sp, #S_X0]
> 2:
> 
> If you will be comfortable, I will submit a new patch soon.

Yes, please send a new series including this change.

Will

  reply	other threads:[~2014-11-25 13:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18  1:10 [PATCH v8 0/6] arm64: add seccomp support AKASHI Takahiro
2014-11-18  1:10 ` [PATCH v8 1/6] arm64: ptrace: add NT_ARM_SYSTEM_CALL regset AKASHI Takahiro
2014-11-18  1:10 ` [PATCH v8 2/6] arm64: ptrace: allow tracer to skip a system call AKASHI Takahiro
2014-11-18 14:04   ` Will Deacon
2014-11-19  8:46     ` AKASHI Takahiro
2014-11-19 19:06       ` Will Deacon
2014-11-20  5:13         ` AKASHI Takahiro
2014-11-20  5:52           ` AKASHI Takahiro
2014-11-25 13:56             ` Will Deacon [this message]
2014-11-20 19:17           ` Will Deacon
2014-11-25  7:42             ` AKASHI Takahiro
2014-11-25 10:30               ` Will Deacon
2014-11-25 14:14           ` Russell King - ARM Linux
2014-11-18  1:10 ` [PATCH v8 3/6] asm-generic: add generic seccomp.h for secure computing mode 1 AKASHI Takahiro
2014-11-18  1:10 ` [PATCH v8 4/6] arm64: add seccomp syscall for compat task AKASHI Takahiro
2014-11-18  1:10 ` [PATCH v8 5/6] arm64: add SIGSYS siginfo " AKASHI Takahiro
2014-11-18  1:10 ` [PATCH v8 6/6] arm64: add seccomp support AKASHI Takahiro

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=20141125135626.GB8541@arm.com \
    --to=will.deacon@arm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=arndb@arndb.de \
    --cc=dsaxena@linaro.org \
    --cc=keescook@chromium.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=takahiro.akashi@linaro.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

Powered by JetHome