* [uml-devel] [patch] fix fault handling
@ 2004-05-17 17:21 Gerd Knorr
2004-05-20 0:26 ` [uml-devel] " Jeff Dike
0 siblings, 1 reply; 2+ messages in thread
From: Gerd Knorr @ 2004-05-17 17:21 UTC (permalink / raw)
To: Jeff Dike, uml devel
Hi,
skas has a design bug: PTRACE_FAULTINFO doesn't pass enougth
informations. Specifically the trap_no is missing, so you
don't know for sure whenever the SIGSEGV was a page fault or
a general protection fault. I think that should be fixed in
skas4 (where we'll break backward compatibility anyway).
For the time being I've tried to fix that with the patch below,
which makes the uml kernel pass through general protection SEGV
to the app and seems to have no ill side effects.
Gerd
--- linux-2.6.5/arch/um/kernel/skas/process.c.segv 2004-05-14 18:40:36.155621129 +0200
+++ linux-2.6.5/arch/um/kernel/skas/process.c 2004-05-14 19:49:00.762159068 +0200
@@ -54,6 +54,17 @@
panic("handle_segv - PTRACE_FAULTINFO failed, errno = %d\n",
errno);
+ if (!(fault.is_write & 4)) {
+ /*
+ kernel fault -- likely that was general
+ protection fault (trap_no = 13), not a
+ page fault (trap_no = 14). But we don't
+ know for sure as PTRACE_FAULTINFO doesn't
+ tell us :-/
+ */
+ bad_segv(fault.addr, 0, fault.is_write);
+ return;
+ }
segv(fault.addr, 0, FAULT_WRITE(fault.is_write), 1, NULL);
}
-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-05-19 23:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-17 17:21 [uml-devel] [patch] fix fault handling Gerd Knorr
2004-05-20 0:26 ` [uml-devel] " Jeff Dike
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox