]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[S390] fix user readable uninitialised kernel memory, take 2.
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Sun, 5 Nov 2006 07:03:01 +0000 (08:03 +0100)
committerAdrian Bunk <bunk@stusta.de>
Sun, 5 Nov 2006 07:03:01 +0000 (08:03 +0100)
The previous patch to correct the copy_from_user padding is quite
broken. The execute instruction needs to be done via the register %r4,
not via %r2 and 31 bit doesn't know the instructions lgr and ahji.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
arch/s390/lib/uaccess.S
arch/s390/lib/uaccess64.S

index d4c218c2b65742b21cc393026ee59b02f4c22bb3..0028a5461ca7ebd055d7876def9c8c6eee1cd111 100644 (file)
@@ -41,15 +41,15 @@ __copy_from_user_asm:
 5:     mvcp    0(%r5,%r2),0(%r4),%r0
        slr     %r3,%r5
        alr     %r2,%r5
-6:     lgr     %r5,%r3         # copy remaining size
+6:     l     %r5,%r3         # copy remaining size
        ahi     %r5,-1          # subtract 1 for xc loop
        bras    %r4,8f
-       xc      0(1,%2),0(%2)
-7:     xc      0(256,%2),0(%2)
+       xc      0(1,%r2),0(%r2)
+7:     xc      0(256,%r2),0(%r2)
        la      %r2,256(%r2)
-8:     ahji    %r5,-256
+8:     ah    %r5,-256
        jnm     7b
-       ex      %r5,0(%r2)
+       ex      %r5,0(%r4)
 9:     lr      %r2,%r3
        br      %r14
         .section __ex_table,"a"
index 9811e8a2fc8bc220ce62c66e635854cbc7af19e4..7fbe36311cd57273d611d789157eba298ac73d80 100644 (file)
@@ -49,7 +49,7 @@ __copy_from_user_asm:
        la      %r2,256(%r2)
 8:     aghi    %r5,-256
        jnm     7b
-       ex      %r5,0(%r2)
+       ex      %r5,0(%r4)
 9:     lgr     %r2,%r3
        br      %r14
         .section __ex_table,"a"