From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: [patch 1/9] s390: kernel faults.
Date: Thu, 24 Mar 2005 14:31:38 +0100 [thread overview]
Message-ID: <20050324133138.GA5002@mschwid3.boeblingen.de.ibm.com> (raw)
[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;
}
/*
reply other threads:[~2005-03-24 13:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050324133138.GA5002@mschwid3.boeblingen.de.ibm.com \
--to=schwidefsky@de.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®