[PATCH] ppc64: syscall error test incorrect for 64 bits results

From: Benjamin Herrenschmidt
Date: Mon Mar 29 2004 - 03:57:31 EST

Hi !

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.

This patch fixes that.

===== arch/ppc64/kernel/entry.S 1.32 vs edited =====
--- 1.32/arch/ppc64/kernel/entry.S Fri Mar 19 16:59:29 2004
+++ edited/arch/ppc64/kernel/entry.S Fri Mar 26 17:56:07 2004
@@ -139,7 +139,7 @@
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 */

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/