diff -rupN failed-3.11.7-hardened-r1/include/linux/mm.h patched-3.11.7-hardened-r1/include/linux/mm.h
--- failed-3.11.7-hardened-r1/include/linux/mm.h	2014-01-13 11:39:49.711568055 -0800
+++ patched-3.11.7-hardened-r1/include/linux/mm.h	2014-01-13 11:38:58.240567381 -0800
@@ -1032,6 +1032,89 @@ static inline int fixup_user_fault(struc
 }
 #endif
 
+/*
+ * Mainly for aufs which mmap(2) diffrent file and wants to print different path
+ * in /proc/PID/maps.
+ */
+/* #define AUFS_DEBUG_MMAP */
+static inline void aufs_trace(struct file *f, struct file *pr,
+                             const char func[], int line, const char func2[])
+{
+#ifdef AUFS_DEBUG_MMAP
+       if (pr)
+               pr_info("%s:%d: %s, %p\n", func, line, func2,
+                       f ? (char *)f->f_dentry->d_name.name : "(null)");
+#endif
+}
+
+static inline struct file *vmr_do_pr_or_file(struct vm_region *region,
+                                            const char func[], int line)
+{
+       struct file *f = region->vm_file, *pr = region->vm_prfile;
+       aufs_trace(f, pr, func, line, __func__);
+       return (f && pr) ? pr : f;
+}
+
+static inline void vmr_do_fput(struct vm_region *region,
+                              const char func[], int line)
+{
+       struct file *f = region->vm_file, *pr = region->vm_prfile;
+       aufs_trace(f, pr, func, line, __func__);
+       fput(f);
+       if (f && pr)
+               fput(pr);
+}
+
+static inline void vma_do_file_update_time(struct vm_area_struct *vma,
+                                          const char func[], int line)
+{
+       struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+       aufs_trace(f, pr, func, line, __func__);
+       file_update_time(f);
+       if (f && pr)
+               file_update_time(pr);
+}
+
+static inline struct file *vma_do_pr_or_file(struct vm_area_struct *vma,
+                                            const char func[], int line)
+{
+       struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+       aufs_trace(f, pr, func, line, __func__);
+       return (f && pr) ? pr : f;
+}
+
+static inline void vma_do_get_file(struct vm_area_struct *vma,
+                                  const char func[], int line)
+{
+       struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+       aufs_trace(f, pr, func, line, __func__);
+       get_file(f);
+       if (f && pr)
+               get_file(pr);
+}
+
+static inline void vma_do_fput(struct vm_area_struct *vma,
+                              const char func[], int line)
+{
+       struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+       aufs_trace(f, pr, func, line, __func__);
+       fput(f);
+       if (f && pr)
+               fput(pr);
+}
+
+#define vmr_pr_or_file(region)         vmr_do_pr_or_file(region, __func__, \
+                                                         __LINE__)
+#define vmr_fput(region)               vmr_do_fput(region, __func__, __LINE__)
+#define vma_file_update_time(vma)      vma_do_file_update_time(vma, __func__, \
+                                                               __LINE__)
+#define vma_pr_or_file(vma)            vma_do_pr_or_file(vma, __func__, \
+                                                         __LINE__)
+#define vma_get_file(vma)              vma_do_get_file(vma, __func__, __LINE__)
+#define vma_fput(vma)                  vma_do_fput(vma, __func__, __LINE__)
+
+
+
 extern ssize_t access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, size_t len, int write);
 extern ssize_t access_remote_vm(struct mm_struct *mm, unsigned long addr,
 		void *buf, size_t len, int write);
diff -rupN failed-3.11.7-hardened-r1/kernel/fork.c patched-3.11.7-hardened-r1/kernel/fork.c
--- failed-3.11.7-hardened-r1/kernel/fork.c	2014-01-13 11:26:52.000000000 -0800
+++ patched-3.11.7-hardened-r1/kernel/fork.c	2014-01-13 11:38:58.240567381 -0800
@@ -380,7 +380,7 @@ static struct vm_area_struct *dup_vma(st
 		struct inode *inode = file_inode(file);
 		struct address_space *mapping = file->f_mapping;
 
-		get_file(file);
+		vma_get_file(tmp);
 		if (tmp->vm_flags & VM_DENYWRITE)
 			atomic_dec(&inode->i_writecount);
 		mutex_lock(&mapping->i_mmap_mutex);
diff -rupN failed-3.11.7-hardened-r1/mm/mmap.c patched-3.11.7-hardened-r1/mm/mmap.c
--- failed-3.11.7-hardened-r1/mm/mmap.c	2014-01-13 11:39:49.714568055 -0800
+++ patched-3.11.7-hardened-r1/mm/mmap.c	2014-01-13 11:38:58.242567381 -0800
@@ -1782,8 +1782,8 @@ out:
 unmap_and_free_vma:
 	if (correct_wcount)
 		atomic_inc(&inode->i_writecount);
+	vma_fput(vma);
 	vma->vm_file = NULL;
-	fput(file);
 
 	/* Undo any partial mapping done by a device driver. */
 	unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end);
@@ -2853,7 +2853,7 @@ static int __split_vma(struct mm_struct
 			if (new_m->vm_ops && new_m->vm_ops->close)
 				new_m->vm_ops->close(new_m);
 			if (new_m->vm_file)
-				fput(new_m->vm_file);
+				vma_fput(new_m);	
 			mpol_put(pol);
 		}
 	}
@@ -2867,7 +2867,7 @@ static int __split_vma(struct mm_struct
 	if (new->vm_ops && new->vm_ops->close)
 		new->vm_ops->close(new);
 	if (new->vm_file)
-		fput(new->vm_file);
+		vma_fput(new);
  out_free_mpol:
 	mpol_put(pol);
  out_free_vma: