Skip to contentSkip to conversation

UML - Increase granularity of host capability checking

PATCH In review Jeff Dike 1 participant 1 message Sep 1, 2005 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 8/12 UML - Increase granularity of host capability checking

From: Bodo Stroesser <[email protected]>

This change enables SKAS0/SKAS3 to work with all combinations of /proc/mm and PTRACE_FAULTINFO being available or not.

Also it changes the initialization of proc_mm and ptrace_faultinfo slightly, to ease forcing SKAS0 on a patched host. Forcing UML to run without /proc/mm or PTRACE_FAULTINFO by cmdline parameter can be implemented with a setup resetting the related variable.

arch/um/kernel/skas/include/skas.h +1 -1
Index: test/arch/um/kernel/skas/include/skas.h
===================================================================
@@ -33,7 +33,7 @@
 		     unsigned long len, int r, int w, int x, int done,
 		     void *data);
 extern void user_signal(int sig, union uml_pt_regs *regs, int pid);
-extern int new_mm(int from);
+extern int new_mm(int from, unsigned long stack);
 extern int start_userspace(unsigned long stub_stack);
 extern int copy_context_skas0(unsigned long stack, int pid);
 extern void get_skas_faultinfo(int pid, struct faultinfo * fi);
arch/um/kernel/skas/mmu.c +29 -25

87 lines not on this page · raw message

arch/um/kernel/skas/process.c +61 -8

110 lines not on this page · raw message

arch/um/kernel/skas/process_kern.c +6 -1
Index: test/arch/um/kernel/skas/process_kern.c
===================================================================
@@ -129,7 +129,9 @@
 	return(0);
 }
 
-int new_mm(int from)
+extern void map_stub_pages(int fd, unsigned long code,
+			   unsigned long data, unsigned long stack);
+int new_mm(int from, unsigned long stack)
 {
 	struct proc_mm_op copy;
 	int n, fd;
@@ -148,6 +150,9 @@
 			       "err = %d\n", -n);
 	}
 
+	if(!ptrace_faultinfo)
+		map_stub_pages(fd, CONFIG_STUB_CODE, CONFIG_STUB_DATA, stack);
+
 	return(fd);
 }
 

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel