* [PATCH] ARM: entry: fix tracing of ARM-private syscalls
@ 2013-09-18 16:12 Will Deacon
2013-09-18 21:09 ` Jason Gunthorpe
0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2013-09-18 16:12 UTC (permalink / raw)
To: linux-arm-kernel
Commit 377747c40657 ("ARM: entry: allow ARM-private syscalls to be
restarted") reworked the low-level syscall dispatcher to allow
restarting of ARM-private syscalls. Unfortunately, this relocated the
label used to dispatch a private syscall from the trace path, so that
the invocation would be bypassed altogether!
This causes applications to fail under strace as soon as they rely on
a private syscall (e.g. set_tls):
set_tls(0xb6fad4c0, 0xb6fadb98, 0xb6fb1050, 0xb6fad4c0, 0xb6fb1050)
= -1 ENOSYS (Function not implemented)
This patch fixes the label so that we correctly dispatch private
syscalls from the trace path.
Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/kernel/entry-common.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 74ad15d1..bc6bd96 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -442,10 +442,10 @@ local_restart:
ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
add r1, sp, #S_OFF
- cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE)
+2: cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE)
eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back
bcs arm_syscall
-2: mov why, #0 @ no longer a real syscall
+ mov why, #0 @ no longer a real syscall
b sys_ni_syscall @ not private func
#if defined(CONFIG_OABI_COMPAT) || !defined(CONFIG_AEABI)
--
1.8.2.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] ARM: entry: fix tracing of ARM-private syscalls
2013-09-18 16:12 [PATCH] ARM: entry: fix tracing of ARM-private syscalls Will Deacon
@ 2013-09-18 21:09 ` Jason Gunthorpe
2013-09-19 9:08 ` Will Deacon
0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2013-09-18 21:09 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 18, 2013 at 05:12:45PM +0100, Will Deacon wrote:
> Commit 377747c40657 ("ARM: entry: allow ARM-private syscalls to be
> restarted") reworked the low-level syscall dispatcher to allow
> restarting of ARM-private syscalls. Unfortunately, this relocated the
> label used to dispatch a private syscall from the trace path, so that
> the invocation would be bypassed altogether!
>
> This causes applications to fail under strace as soon as they rely on
> a private syscall (e.g. set_tls):
>
> set_tls(0xb6fad4c0, 0xb6fadb98, 0xb6fb1050, 0xb6fad4c0, 0xb6fb1050)
> = -1 ENOSYS (Function not implemented)
>
> This patch fixes the label so that we correctly dispatch private
> syscalls from the trace path.
>
> Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Worked here
Tested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
This should probably go into the 3.11 stable series too?
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH] ARM: entry: fix tracing of ARM-private syscalls
2013-09-18 21:09 ` Jason Gunthorpe
@ 2013-09-19 9:08 ` Will Deacon
0 siblings, 0 replies; 3+ messages in thread
From: Will Deacon @ 2013-09-19 9:08 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 18, 2013 at 10:09:11PM +0100, Jason Gunthorpe wrote:
> On Wed, Sep 18, 2013 at 05:12:45PM +0100, Will Deacon wrote:
> > Commit 377747c40657 ("ARM: entry: allow ARM-private syscalls to be
> > restarted") reworked the low-level syscall dispatcher to allow
> > restarting of ARM-private syscalls. Unfortunately, this relocated the
> > label used to dispatch a private syscall from the trace path, so that
> > the invocation would be bypassed altogether!
> >
> > This causes applications to fail under strace as soon as they rely on
> > a private syscall (e.g. set_tls):
> >
> > set_tls(0xb6fad4c0, 0xb6fadb98, 0xb6fb1050, 0xb6fad4c0, 0xb6fb1050)
> > = -1 ENOSYS (Function not implemented)
> >
> > This patch fixes the label so that we correctly dispatch private
> > syscalls from the trace path.
> >
> > Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
>
> Worked here
>
> Tested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Thanks Jason, I'll send this to Russell.
> This should probably go into the 3.11 stable series too?
This problem was introduced during the merge window, so 3.11 shouldn't be
affected.
Will
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-09-19 9:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-18 16:12 [PATCH] ARM: entry: fix tracing of ARM-private syscalls Will Deacon
2013-09-18 21:09 ` Jason Gunthorpe
2013-09-19 9:08 ` Will Deacon
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).