Skip to contentSkip to conversation

fix fault handling

PATCH In review Gerd Knorr 2 participants 2 messages May 17, 2004 – May 19, 2004 User-mode Linux (UML)

lore
Share & tools
lore

Gerd Knorr

author
#0 lore raw

PATCH 1/1 fix fault handling

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

arch/um/kernel/skas/process.c renamed from arch/um/kernel/skas/process.c.segv +11 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 2 lines · [email protected] said:

skas has a design bug: PTRACE_FAULTINFO doesn't pass enougth informations.

Yeah, this is the biggest technical mistake in skas3. I left it because I didn't really want to touch the skas3 patch again, and instead fix it in skas4.

Jeff

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel