summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDave Kleikamp <dave.kleikamp@oracle.com>2014-03-14 10:42:01 -0500
committerBen Hutchings <ben@decadent.org.uk>2014-04-30 16:23:18 +0100
commitb2d56d0f73e93d78a9983d1c4dc512a68f63ab98 (patch)
tree1a843e547ba01ab2c80503a255f776c8cf9fb5f0 /arch
parent8a937060cba9bbea7a2679dbe09679dc9bdaacfe (diff)
downloadlinux-stable-b2d56d0f73e93d78a9983d1c4dc512a68f63ab98.tar.gz
linux-stable-b2d56d0f73e93d78a9983d1c4dc512a68f63ab98.tar.bz2
linux-stable-b2d56d0f73e93d78a9983d1c4dc512a68f63ab98.zip
sparc64: don't treat 64-bit syscall return codes as 32-bit
[ 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: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/kernel/syscalls.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
index 817187d42777..557212cfa0f2 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -184,7 +184,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
@@ -212,7 +213,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