Skip to content

Commit

Permalink
k6.1.120 patch & k5.10, k5.15 minor patches (#4337)
Browse files Browse the repository at this point in the history
  • Loading branch information
peabee authored Dec 16, 2024
1 parent d008850 commit 44d447a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
13 changes: 12 additions & 1 deletion kernel-kit/patches/aufs_sources/apply
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,21 @@ if [ "$kseries" = "5.10" ] ; then
# courtesy of JamesBond
patch -N -p1 < ../patches/aufs_sources/k5.10.x.patch
fi
if vercmp $kver ge 5.10.231 ; then
sed -i 's%unmap_and_free_vma:%unmap_and_free_file_vma:%' aufs5-mmap.patch
fi
fi

if [ "$kseries" = "5.15" ] ; then
if vercmp $kver ge 5.15.174 ; then
sed -i 's%unmap_and_free_vma:%unmap_and_free_file_vma:%' aufs5-mmap.patch
fi
fi

if [ "$kseries" = "6.1" ] ; then
if vercmp $kver ge 6.1.119 ; then
if vercmp $kver ge 6.1.120 ; then
patch aufs6-mmap.patch ../patches/aufs_sources/k6.1.120.patch
elif vercmp $kver ge 6.1.119 ; then
patch aufs6-mmap.patch ../patches/aufs_sources/k6.1.119.patch
fi
fi
Expand Down
33 changes: 33 additions & 0 deletions kernel-kit/patches/aufs_sources/k6.1.120.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--- aufs6-mmap.patch.orig 2024-12-16 11:48:28.413329126 +0000
+++ aufs6-mmap.patch 2024-12-16 11:36:15.006638797 +0000
@@ -239,7 +239,7 @@
@@ -2746,7 +2746,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
- unmap_and_free_vma:
+ unmap_and_free_file_vma:
- fput(vma->vm_file);
+ vma_fput(vma);
vma->vm_file = NULL;
@@ -255,7 +255,7 @@

pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/mm/remap_file_pages.rst.\n",
current->comm, current->pid);
-@@ -2871,10 +2874,34 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+@@ -2871,14 +2874,38 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
if (vma->vm_flags & VM_LOCKED)
flags |= MAP_LOCKED;

@@ -283,8 +283,12 @@
+ fput(prfile);
+#else
file = get_file(vma->vm_file);
+ ret = security_mmap_file(vma->vm_file, prot, flags);
+ if (ret)
+ goto out_fput;
ret = do_mmap(vma->vm_file, start, size,
prot, flags, pgoff, &populate, NULL);
+ out_fput:
fput(file);
+#endif /* CONFIG_AUFS_FS */
out:

0 comments on commit 44d447a

Please sign in to comment.