Skip to contentSkip to conversation

ARM: entry: fix tracing of ARM-private syscalls

PATCH New Will Deacon 2 participants 3 messages Sep 18, 2013 – Sep 19, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: entry: fix tracing of ARM-private syscalls

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.

---
 arch/arm/kernel/entry-common.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/kernel/entry-common.S +2 -2
index 74ad15d1..bc6bd96 100644
@@ -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)
Signature · 1 line
1.8.2.2
#1 lore raw

PATCH 1/1 ARM: entry: fix tracing of ARM-private syscalls

Quoted 9 lines · Will Deacon

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):

Quoted 8 lines

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.

Worked here

This should probably go into the 3.11 stable series too?

Jason

#2 lore raw

PATCH 1/1 ARM: entry: fix tracing of ARM-private syscalls

Quoted 16 lines · Jason Gunthorpe
Quoted 15 lines · Will Deacon

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.

Quoted 6 lines
Quoted 2 lines

Worked here

Thanks Jason, I'll send this to Russell.

Quoted 1 line

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