From 44d447aa6d0f01efc57efa4e391e705430086986 Mon Sep 17 00:00:00 2001 From: PB Date: Mon, 16 Dec 2024 16:15:35 +0000 Subject: [PATCH] k6.1.120 patch & k5.10, k5.15 minor patches (#4337) --- kernel-kit/patches/aufs_sources/apply | 13 +++++++- .../patches/aufs_sources/k6.1.120.patch | 33 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 kernel-kit/patches/aufs_sources/k6.1.120.patch diff --git a/kernel-kit/patches/aufs_sources/apply b/kernel-kit/patches/aufs_sources/apply index 28f386772b..f245723031 100755 --- a/kernel-kit/patches/aufs_sources/apply +++ b/kernel-kit/patches/aufs_sources/apply @@ -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 diff --git a/kernel-kit/patches/aufs_sources/k6.1.120.patch b/kernel-kit/patches/aufs_sources/k6.1.120.patch new file mode 100644 index 0000000000..ab8f44d6f6 --- /dev/null +++ b/kernel-kit/patches/aufs_sources/k6.1.120.patch @@ -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: