All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch added to the 3.12 stable tree] sparc64: don't treat 64-bit syscall return codes as 32-bit
@ 2014-04-28  7:47 Jiri Slaby
  2014-04-28  7:47 ` Jiri Slaby
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jiri Slaby @ 2014-04-28  7:47 UTC (permalink / raw)
  To: sparclinux

From: Dave Kleikamp <dave.kleikamp@oracle.com>

This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.

=======
[ Upstream commit 1535bd8adbdedd60a0ee62e28fd5225d66434371 ]

When checking a system call return code for an error,
linux_sparc_syscall was sign-extending the lower 32-bit value and
comparing it to -ERESTART_RESTARTBLOCK. lseek can return valid return
codes whose lower 32-bits alone would indicate a failure (such as 4G-1).
Use the whole 64-bit value to check for errors. Only the 32-bit path
should sign extend the lower 32-bit value.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Acked-by: Bob Picco <bob.picco@oracle.com>
Acked-by: Allen Pais <allen.pais@oracle.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/sparc/kernel/syscalls.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
index d950197a17e1..6dee79575791 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -189,7 +189,8 @@ linux_sparc_syscall32:
 	 mov	%i0, %l5				! IEU1
 5:	call	%l7					! CTI	Group brk forced
 	 srl	%i5, 0, %o5				! IEU1
-	ba,a,pt	%xcc, 3f
+	ba,pt	%xcc, 3f
+	 sra	%o0, 0, %o0
 
 	/* Linux native system calls enter here... */
 	.align	32
@@ -217,7 +218,6 @@ linux_sparc_syscall:
 3:	stx	%o0, [%sp + PTREGS_OFF + PT_V9_I0]
 ret_sys_call:
 	ldx	[%sp + PTREGS_OFF + PT_V9_TSTATE], %g3
-	sra	%o0, 0, %o0
 	mov	%ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
 	sllx	%g2, 32, %g2
 
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-30 23:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-28  7:47 [patch added to the 3.12 stable tree] sparc64: don't treat 64-bit syscall return codes as 32-bit Jiri Slaby
2014-04-28  7:47 ` Jiri Slaby
2014-10-30 23:04 ` [patch added to the 3.12 stable tree] sparc64: sun4v TLB error power off events Jiri Slaby
2014-10-30 23:04 ` [patch added to the 3.12 stable tree] sparc64: find_node adjustment Jiri Slaby
2014-10-30 23:04 ` [patch added to the 3.12 stable tree] sparc64: Increase size of boot string to 1024 bytes Jiri Slaby
2014-10-30 23:04 ` [patch added to the 3.12 stable tree] sparc64: T5 PMU Jiri Slaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.