mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 1/9] s390: kernel faults.
@ 2005-03-24 13:31 Martin Schwidefsky
  0 siblings, 0 replies; only message in thread
From: Martin Schwidefsky @ 2005-03-24 13:31 UTC (permalink / raw)
  To: akpm, linux-kernel

[patch 1/9] s390: kernel faults.

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

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 <schwidefsky@de.ibm.com>

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;
 }
 
 /*

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-24 13:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-24 13:31 [patch 1/9] s390: kernel faults Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®