[patch 1/9] s390: kernel faults.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[patch 1/9] s390: kernel faults.

From: Martin Schwidefsky <[email protected]>

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]>

diffstat:
 arch/s390/mm/fault.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff -urpN linux-2.6/arch/s390/mm/fault.c linux-2.6-patched/arch/s390/mm/fault.c
--- linux-2.6/arch/s390/mm/fault.c	2005-03-02 08:38:38.000000000 +0100
+++ linux-2.6-patched/arch/s390/mm/fault.c	2005-03-24 14:02:59.000000000 +0100
@@ -87,6 +87,7 @@ static int __check_access_register(struc
 	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 @@ static inline int check_user_space(struc
 	 *   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 linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux