ChangeSet 1.2231.1.115, 2005/03/28 19:48:30-08:00, [EMAIL PROTECTED]

        [PATCH] s390: kernel faults
        
        Correct check for user space faults.  If the failing address space is 
in the
        secondary address space and uaccess has been switched to KERNEL_DS with
        set_fs, check_user_space() erroneously returns 1.
        
        Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 fault.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


diff -Nru a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
--- a/arch/s390/mm/fault.c      2005-03-28 21:31:48 -08:00
+++ b/arch/s390/mm/fault.c      2005-03-28 21:31:48 -08:00
@@ -87,6 +87,7 @@
        if (areg == 0)
                /* Access via access register 0 -> kernel address */
                return 0;
+       save_access_regs(current->thread.acrs);
        if (regs && areg < NUM_ACRS && current->thread.acrs[areg] <= 1)
                /*
                 * access register contains 0 -> kernel address,
@@ -115,11 +116,11 @@
         *   3: Home Segment Table Descriptor
         */
        int descriptor = S390_lowcore.trans_exc_code & 3;
-       if (descriptor == 1) {
-               save_access_regs(current->thread.acrs);
+       if (unlikely(descriptor == 1))
                return __check_access_register(regs, error_code);
-       }
-       return descriptor >> 1;
+       if (descriptor == 2)
+               return current->thread.mm_segment.ar4;
+       return descriptor != 0;
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to