[parisc-linux-cvs] clear top half of arg registers on syscall entry
Richard Hirst
rhirst@linuxcare.com
Wed, 6 Jun 2001 19:28:55 +0100
Hi,
On the A500 I found e2fsck crashed. Userland calls sys_read with
a count of 0x400, but there is really 0xffffffff00000400 in the
register. Only happens if e2fsck is built with -O2.
e2fsprogs-1.20.deb failed, e2fsprogs-1.19.deb worked.
Not obvious from the diff below, but this change is inside an
ifdef __LP64__.
Richard
Index: Makefile
===================================================================
RCS file: /home/cvs/parisc/linux/Makefile,v
retrieving revision 1.43
diff -u -r1.43 Makefile
--- Makefile 2001/05/30 17:16:29 1.43
+++ Makefile 2001/06/06 18:13:44
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 0
-EXTRAVERSION = -pa10
+EXTRAVERSION = -pa11
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
Index: arch/parisc/kernel/syscall.S
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/syscall.S,v
retrieving revision 1.67
diff -u -r1.67 syscall.S
--- syscall.S 2001/05/17 15:04:01 1.67
+++ syscall.S 2001/06/06 18:13:45
@@ -76,6 +76,13 @@
* whether to do narrow or wide syscalls. -PB
*/
ssm PSW_SM_W, %r0
+ /* The top halves of argument registers must be cleared on syscall
+ * entry.
+ */
+ depdi 0, 31, 32, %r26
+ depdi 0, 31, 32, %r25
+ depdi 0, 31, 32, %r24
+ depdi 0, 31, 32, %r23
#endif
mtctl %r28,%cr31
rsm PSW_I, %r28 /* no ints for a bit */