summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/2.6.21/20965_linux-2.6-xen-privcmd-use-nopfn.patch')
-rw-r--r--trunk/2.6.21/20965_linux-2.6-xen-privcmd-use-nopfn.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/trunk/2.6.21/20965_linux-2.6-xen-privcmd-use-nopfn.patch b/trunk/2.6.21/20965_linux-2.6-xen-privcmd-use-nopfn.patch
new file mode 100644
index 0000000..8d80d7b
--- /dev/null
+++ b/trunk/2.6.21/20965_linux-2.6-xen-privcmd-use-nopfn.patch
@@ -0,0 +1,35 @@
+From: Eduardo Habkost <ehabkost@redhat.com>
+Subject: Use the nopfn() handler where nopage() was being used on privcmd
+
+This patch changes the privcmd mmap vma to use nopfn(), that is supposed
+to be used for VM_PFNMAP vmas.
+
+This should make the program receive a SIGBUS (as the original nopage() handler
+was supposed to do) instead of causing an Oops.
+
+Signed-off-by: Eduardo Habkost <ehabkost@redhat.com
+---
+Index: linux-2.6.21-xen-3.1.0/drivers/xen/privcmd/privcmd.c
+===================================================================
+--- linux-2.6.21-xen-3.1.0.orig/drivers/xen/privcmd/privcmd.c
++++ linux-2.6.21-xen-3.1.0/drivers/xen/privcmd/privcmd.c
+@@ -216,15 +216,14 @@ static int privcmd_ioctl(struct inode *i
+ }
+
+ #ifndef HAVE_ARCH_PRIVCMD_MMAP
+-static struct page *privcmd_nopage(struct vm_area_struct *vma,
+- unsigned long address,
+- int *type)
++unsigned long privcmd_nopfn(struct vm_area_struct *vma,
++ unsigned long address)
+ {
+- return NOPAGE_SIGBUS;
++ return NOPFN_SIGBUS;
+ }
+
+ static struct vm_operations_struct privcmd_vm_ops = {
+- .nopage = privcmd_nopage
++ .nopfn = privcmd_nopfn
+ };
+
+ static int privcmd_mmap(struct file * file, struct vm_area_struct * vma)