Well, nobody complained about my 2.6.24 port, so I figured that now,
11 months later, it was time to release a 2.6.25 SKAS3 patch. :) I do
plan on immediately moving to 2.6.26 and 2.6.27, but I figured baby
steps are the best for getting SKAS3 up to speed. Please take a look
and let me know if you find anything wrong.
RF
--
This is a SKAS3 patch for Linux 2.6.25 and 2.6.25.x (last tested
2008-12-08 with 2.6.25.20). If you have any questions or problems,
please ask on the uml-user list (URL below). I may be maintaining
this patch, but I not a C programmer; I just play one on TV.
--Ryan Finnie <[EMAIL PROTECTED]>
Download location:
http://www.finnie.org/software/uml/2.6.25-skas3.patch
uml-user list:
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user
arch/um/sys-i386/ldt.c |2
arch/x86/Kconfig | 21 ++
arch/x86/ia32/sys_ia32.c | 16 +-
arch/x86/kernel/ldt.c| 58 ---
arch/x86/kernel/ptrace.c | 63
arch/x86/kernel/sys_i386_32.c| 27 ++-
arch/x86/kernel/sys_x86_64.c | 15 +
arch/x86/mm/Makefile_64 |1
arch/x86/mm/proc_mm_64.c | 85 +++
include/asm-um/compat.h |9 +
include/asm-um/proc_mm_32.h |1
include/asm-um/proc_mm_64.h |1
include/asm-um/ptrace-x86_64.h |1
include/asm-x86/desc.h |3
include/asm-x86/mmu_context_32.h | 19 ++
include/asm-x86/mmu_context_64.h | 20 ++
include/asm-x86/proc_mm_32.h | 18 ++
include/asm-x86/proc_mm_64.h | 58 +++
include/asm-x86/ptrace-abi.h |6
include/asm-x86/ptrace.h | 65
include/linux/mm.h | 19 +-
include/linux/proc_mm.h | 110 ++
mm/Makefile |5
mm/fremap.c |2
mm/mmap.c| 17 +-
mm/mprotect.c| 20 +-
mm/proc_mm-mod.c | 50 ++
mm/proc_mm.c | 299 +++
28 files changed, 949 insertions(+), 62 deletions(-)
diff -ruN linux-2.6.25.orig/arch/um/sys-i386/ldt.c
linux-2.6.25/arch/um/sys-i386/ldt.c
--- linux-2.6.25.orig/arch/um/sys-i386/ldt.c2008-04-16 19:49:44.0
-0700
+++ linux-2.6.25/arch/um/sys-i386/ldt.c 2008-12-08 14:58:14.0 -0800
@@ -7,7 +7,7 @@
#include
#include
#include "os.h"
-#include "proc_mm.h"
+#include "linux/proc_mm.h"
#include "skas.h"
#include "skas_ptrace.h"
#include "sysdep/tls.h"
diff -ruN linux-2.6.25.orig/arch/x86/ia32/sys_ia32.c
linux-2.6.25/arch/x86/ia32/sys_ia32.c
--- linux-2.6.25.orig/arch/x86/ia32/sys_ia32.c 2008-04-16 19:49:44.0
-0700
+++ linux-2.6.25/arch/x86/ia32/sys_ia32.c 2008-12-08 15:01:53.0
-0800
@@ -695,11 +695,10 @@
return ret;
}
-asmlinkage long sys32_mmap2(unsigned long addr, unsigned long len,
- unsigned long prot, unsigned long flags,
+long do32_mmap2(struct mm_struct *mm, unsigned long addr,
+ unsigned long len, unsigned long prot, unsigned
long flags,
unsigned long fd, unsigned long pgoff)
{
- struct mm_struct *mm = current->mm;
unsigned long error;
struct file *file = NULL;
@@ -711,7 +710,7 @@
}
down_write(&mm->mmap_sem);
- error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
+ error = __do_mmap_pgoff(mm, file, addr, len, prot, flags, pgoff);
up_write(&mm->mmap_sem);
if (file)
@@ -719,6 +718,15 @@
return error;
}
+/* XXX: this wrapper can be probably removed, we can simply use the 64-bit
+ * version.*/
+asmlinkage long sys32_mmap2(unsigned long addr, unsigned long len,
+ unsigned long prot, unsigned long flags,
+ unsigned long fd, unsigned long pgoff)
+{
+ return do32_mmap2(current->mm, addr, len, prot, flags, fd, pgoff);
+}
+
asmlinkage long sys32_olduname(struct oldold_utsname __user *name)
{
char *arch = "x86_64";
diff -ruN linux-2.6.25.orig/arch/x86/Kconfig linux-2.6.25/arch/x86/Kconfig
--- linux-2.6.25.orig/arch/x86/Kconfig 2008-04-16 19:49:44.0 -0700
+++ linux-2.6.25/arch/x86/Kconfig 2008-12-08 14:58:20.0 -0800
@@ -836,6 +836,27 @@
has the cost of more pagetable lookup overhead, and also
consumes more pagetable space per process.
+config PROC_MM
+ bool "/proc/mm support"
+ default y
+
+config PROC_MM_DUMPABLE
+ bool "Make UML childs /proc/ completely browsable"
+ default n
+ depends on PROC_MM
+ help
+ If in doubt, say N.
+
+ This fiddles with some settings to make sure /proc/ is completely
+ browsable by who started UML, at the expense of some additional
+ locking (maybe this could slow down the runned UMLs of a few percents,
+ I've not tested this).
+
+ Also, if there is a bug