From: Fernando Luis Vazquez Cao <fernando@intellilink.co.jp>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: ak@suse.de, vgoyal@in.ibm.com, linux-kernel@vger.kernel.org,
fastboot@lists.osdl.org
Subject: [PATCH 3/5] stack overflow safe kdump (2.6.15-i386) - fault
Date: Mon, 16 Jan 2006 22:25:41 +0900 [thread overview]
Message-ID: <1137417941.2256.90.camel@localhost.localdomain> (raw)
When we have a bloated stack it is likely that it ends up making an
invalid memory access that in turn causes a page fault. Take this case
into
account in the page fault code.
---
diff -urNp linux-2.6.15/arch/i386/mm/fault.c
linux-2.6.15-sov/arch/i386/mm/fault.c
--- linux-2.6.15/arch/i386/mm/fault.c 2006-01-03 12:21:10.000000000
+0900
+++ linux-2.6.15-sov/arch/i386/mm/fault.c 2006-01-16 20:31:11.000000000
+0900
@@ -245,6 +245,11 @@ fastcall void __kprobes do_page_fault(st
local_irq_enable();
tsk = current;
+ /* We may have invalid '*current' due to a stack overflow. */
+ if (!virt_addr_valid(tsk)) {
+ printk("do_page_fault: Discarding invalid 'current' struct
task_struct * = 0x%p\n", tsk);
+ tsk = NULL;
+ }
si_code = SEGV_MAPERR;
@@ -271,7 +276,14 @@ fastcall void __kprobes do_page_fault(st
goto bad_area_nosemaphore;
}
- mm = tsk->mm;
+ mm = NULL;
+ /* We may have invalid 'tsk' due to a i386 stack overflow */
+ if (tsk)
+ mm = tsk->mm;
+ if (mm && !virt_addr_valid(mm)) {
+ printk("do_page_fault: Discarding invalid current->mm struct
mm_struct * = 0x%p\n", mm);
+ mm = NULL;
+ }
/*
* If we're in an interrupt, have no user context or are running in an
reply other threads:[~2006-01-16 13:25 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=1137417941.2256.90.camel@localhost.localdomain \
--to=fernando@intellilink.co.jp \
--cc=ak@suse.de \
--cc=ebiederm@xmission.com \
--cc=fastboot@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vgoyal@in.ibm.com \
/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®