Updated a couple of mmap interfaces.
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index cbd1996..55a2531 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1043,7 +1043,7 @@
 		 * to write the data to disk first, then we can map the disk
 		 * page in and continue normally from there.
 		 */
-		if((req->cmd == WRITE) && !is_remapped(req->buffer)){
+		if((req->cmd == WRITE) && !is_remapped(req->buffer, dev->fd, io_req->offset + dev->cow.data_offset)){
 			io_req->map_fd = dev->fd;
 			io_req->map_offset = io_req->offset + 
 				dev->cow.data_offset;
@@ -1249,12 +1249,20 @@
 }
 
 static int ubd_check_remapped(int fd, unsigned long address, int is_write,
-			      __u64 offset)
+			      __u64 offset, int is_user)
 {
 	__u64 bitmap_offset;
 	unsigned long new_bitmap[2];
 	int i, err, n;
 
+	/* This can only fix kernelspace faults */
+	if(is_user)
+		return(0);
+
+	/* ubd-mmap is only enabled in skas mode */
+	if(CHOOSE_MODE(1, 0))
+		return(0);
+
 	/* If it's not a write access, we can't do anything about it */
 	if(!is_write)
 		return(0);
diff --git a/arch/um/include/mem.h b/arch/um/include/mem.h
index 7706ede..5ae9e5f 100644
--- a/arch/um/include/mem.h
+++ b/arch/um/include/mem.h
@@ -11,7 +11,7 @@
 extern void set_kmem_end(unsigned long new);
 extern int phys_mapping(unsigned long phys, __u64 *offset_out);
 extern int physmem_subst_mapping(void *virt, int fd, __u64 offset, int w);
-extern int is_remapped(void *virt);
+extern int is_remapped(const void *virt, int fd, __u64 offset);
 extern int physmem_remove_mapping(void *virt);
 extern void physmem_forget_descriptor(int fd);
 
diff --git a/arch/um/include/mem_kern.h b/arch/um/include/mem_kern.h
index b39f03d..699d46d 100644
--- a/arch/um/include/mem_kern.h
+++ b/arch/um/include/mem_kern.h
@@ -11,7 +11,7 @@
 
 struct remapper {
 	struct list_head list;
-	int (*proc)(int, unsigned long, int, __u64);
+	int (*proc)(int, unsigned long, int, __u64, int);
 };
 
 extern void register_remapper(struct remapper *info);
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c
index 2a45005..4b3d56e 100644
--- a/arch/um/kernel/trap_kern.c
+++ b/arch/um/kernel/trap_kern.c
@@ -94,7 +94,7 @@
 	list_add(&info->list, &physmem_remappers);
 }
 
-static int check_remapped_addr(unsigned long address, int is_write)
+static int check_remapped_addr(unsigned long address, int is_write, int is_user)
 {
 	struct remapper *remapper;
 	struct list_head *ele;
@@ -107,7 +107,7 @@
 
 	list_for_each(ele, &physmem_remappers){
 		remapper = list_entry(ele, struct remapper, list);
-		if((*remapper->proc)(fd, address, is_write, offset))
+		if((*remapper->proc)(fd, address, is_write, offset, is_user))
 			return(1);
 	}
 
@@ -125,7 +125,7 @@
                 flush_tlb_kernel_vm();
                 return(0);
         }
-	else if(check_remapped_addr(address & PAGE_MASK, is_write))
+	else if(check_remapped_addr(address & PAGE_MASK, is_write, is_user))
 		return(0);
 	else if(current->mm == NULL)
 		panic("Segfault with no mm");