From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>, adeos-main <adeos-main@gna.org>
Subject: [Adeos-main] [PATCH 2.6.38+] ipipe: x86: Fix user land detection on unhandled non-root faults
Date: Thu, 15 Mar 2012 16:25:49 +0100 [thread overview]
Message-ID: <4F6209FD.5080808@domain.hid> (raw)
Not only page faults are processed by __ipipe_handle_exception, so the
validity and encoding of error_code varies. Use user_mode_vm instead to
detect if the fault was raised over a user context.
Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---
arch/x86/kernel/ipipe.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/ipipe.c b/arch/x86/kernel/ipipe.c
index 5be7005..b2e2a5b 100644
--- a/arch/x86/kernel/ipipe.c
+++ b/arch/x86/kernel/ipipe.c
@@ -560,7 +560,8 @@ int __ipipe_handle_exception(struct pt_regs *regs, long error_code, int vector)
ipipe_trace_panic_freeze();
/* Always warn about user land and unfixable faults. */
- if ((error_code & 4) || !search_exception_tables(instruction_pointer(regs))) {
+ if (user_mode_vm(regs) ||
+ !search_exception_tables(instruction_pointer(regs))) {
printk(KERN_ERR "BUG: Unhandled exception over domain"
" %s at 0x%lx - switching to ROOT\n",
ipd->name, instruction_pointer(regs));
--
1.7.3.4
next reply other threads:[~2012-03-15 15:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-15 15:25 Jan Kiszka [this message]
2012-03-17 10:13 ` [Adeos-main] [PATCH 2.6.38+] ipipe: x86: Fix user land detection on unhandled non-root faults Philippe Gerum
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=4F6209FD.5080808@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=adeos-main@gna.org \
--cc=rpm@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.