commit:     03abf70bafbcb23d545a721da42583adb48800bd
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 11 11:45:11 2023 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Tue Jul 11 11:45:11 2023 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=03abf70b

Linux patch 6.4.3

Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 0000_README            |  4 +++
 1002_linux-6.4.3.patch | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+)

diff --git a/0000_README b/0000_README
index 7e83110e..42e15858 100644
--- a/0000_README
+++ b/0000_README
@@ -51,6 +51,10 @@ Patch:  1001_linux-6.4.2.patch
 From:   https://www.kernel.org
 Desc:   Linux 6.4.2
 
+Patch:  1002_linux-6.4.3.patch
+From:   https://www.kernel.org
+Desc:   Linux 6.4.3
+
 Patch:  1500_XATTR_USER_PREFIX.patch
 From:   https://bugs.gentoo.org/show_bug.cgi?id=470644
 Desc:   Support for namespace user.pax.* on tmpfs.

diff --git a/1002_linux-6.4.3.patch b/1002_linux-6.4.3.patch
new file mode 100644
index 00000000..b0f9b896
--- /dev/null
+++ b/1002_linux-6.4.3.patch
@@ -0,0 +1,94 @@
+diff --git a/Makefile b/Makefile
+index bcac81556b569..56abbcac061d4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+ # SPDX-License-Identifier: GPL-2.0
+ VERSION = 6
+ PATCHLEVEL = 4
+-SUBLEVEL = 2
++SUBLEVEL = 3
+ EXTRAVERSION =
+ NAME = Hurr durr I'ma ninja sloth
+ 
+diff --git a/include/linux/bootmem_info.h b/include/linux/bootmem_info.h
+index cc35d010fa949..e1a3c9c9754c5 100644
+--- a/include/linux/bootmem_info.h
++++ b/include/linux/bootmem_info.h
+@@ -3,6 +3,7 @@
+ #define __LINUX_BOOTMEM_INFO_H
+ 
+ #include <linux/mm.h>
++#include <linux/kmemleak.h>
+ 
+ /*
+  * Types for free bootmem stored in page->lru.next. These have to be in
+@@ -59,6 +60,7 @@ static inline void get_page_bootmem(unsigned long info, 
struct page *page,
+ 
+ static inline void free_bootmem_page(struct page *page)
+ {
++      kmemleak_free_part(page_to_virt(page), PAGE_SIZE);
+       free_reserved_page(page);
+ }
+ #endif
+diff --git a/kernel/fork.c b/kernel/fork.c
+index 41c964104b584..8103ffd217e97 100644
+--- a/kernel/fork.c
++++ b/kernel/fork.c
+@@ -690,6 +690,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
+       for_each_vma(old_vmi, mpnt) {
+               struct file *file;
+ 
++              vma_start_write(mpnt);
+               if (mpnt->vm_flags & VM_DONTCOPY) {
+                       vm_stat_account(mm, mpnt->vm_flags, -vma_pages(mpnt));
+                       continue;
+diff --git a/mm/memory.c b/mm/memory.c
+index 5ce82a76201d5..07bab1e774994 100644
+--- a/mm/memory.c
++++ b/mm/memory.c
+@@ -3932,6 +3932,13 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
+               }
+       }
+ 
++      /*
++       * Some architectures may have to restore extra metadata to the page
++       * when reading from swap. This metadata may be indexed by swap entry
++       * so this must be called before swap_free().
++       */
++      arch_swap_restore(entry, folio);
++
+       /*
+        * Remove the swap entry and conditionally try to free up the swapcache.
+        * We're already holding a reference on the page but haven't mapped it
+diff --git a/mm/mmap.c b/mm/mmap.c
+index bc510361acec2..30bf7772d4ac1 100644
+--- a/mm/mmap.c
++++ b/mm/mmap.c
+@@ -1975,6 +1975,8 @@ static int expand_upwards(struct vm_area_struct *vma, 
unsigned long address)
+               return -ENOMEM;
+       }
+ 
++      /* Lock the VMA before expanding to prevent concurrent page faults */
++      vma_start_write(vma);
+       /*
+        * vma->vm_start/vm_end cannot change under us because the caller
+        * is required to hold the mmap_lock in read mode.  We need the
+@@ -2062,6 +2064,8 @@ int expand_downwards(struct vm_area_struct *vma, 
unsigned long address)
+               return -ENOMEM;
+       }
+ 
++      /* Lock the VMA before expanding to prevent concurrent page faults */
++      vma_start_write(vma);
+       /*
+        * vma->vm_start/vm_end cannot change under us because the caller
+        * is required to hold the mmap_lock in read mode.  We need the
+@@ -2797,6 +2801,8 @@ cannot_expand:
+       if (vma_iter_prealloc(&vmi))
+               goto close_and_free_vma;
+ 
++      /* Lock the VMA since it is modified after insertion into VMA tree */
++      vma_start_write(vma);
+       if (vma->vm_file)
+               i_mmap_lock_write(vma->vm_file->f_mapping);
+ 

Reply via email to