]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ppc64: syscall error test incorrect for 64 bits results
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sun, 28 Mar 2004 23:40:16 +0000 (15:40 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 28 Mar 2004 23:40:16 +0000 (15:40 -0800)
The syscall return path on ppc64 checks if the error is between
-LAST_ERRNO and 0, if it is, does the usual inversion along with
setting a CR bit indicating to glibc that an error occured.

However, we had an interesting bug where we used a 32 bits logica
(unsigned) comparison, thus possibly doing false positives for
valid 64 bits unsigned values whose low 32 bits happen to be in
the error range.

Fix that.

arch/ppc64/kernel/entry.S

index db4f56a39a720586dc50c7711fb89bb6fe21aac1..6ba2f90140af5d33732ca45d56e9802cc1bf6313 100644 (file)
@@ -139,7 +139,7 @@ _GLOBAL(ret_from_syscall_1)
 91:
 #endif
        li      r10,-_LAST_ERRNO
-       cmpl    0,r3,r10
+       cmpld   0,r3,r10
        blt     30f
        neg     r3,r3
 22:    ld      r10,_CCR(r1)    /* Set SO bit in CR */