]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.3-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Jul 2023 09:35:44 +0000 (11:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Jul 2023 09:35:44 +0000 (11:35 +0200)
added patches:
bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch
mm-call-arch_swap_restore-from-do_swap_page.patch

queue-6.3/bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch [new file with mode: 0644]
queue-6.3/drm-amd-display-explicitly-specify-update-type-per-p.patch
queue-6.3/mm-call-arch_swap_restore-from-do_swap_page.patch [new file with mode: 0644]
queue-6.3/series

diff --git a/queue-6.3/bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch b/queue-6.3/bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch
new file mode 100644 (file)
index 0000000..4c7b000
--- /dev/null
@@ -0,0 +1,49 @@
+From 028725e73375a1ff080bbdf9fb503306d0116f28 Mon Sep 17 00:00:00 2001
+From: Liu Shixin <liushixin2@huawei.com>
+Date: Tue, 4 Jul 2023 18:19:42 +0800
+Subject: bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page
+
+From: Liu Shixin <liushixin2@huawei.com>
+
+commit 028725e73375a1ff080bbdf9fb503306d0116f28 upstream.
+
+commit dd0ff4d12dd2 ("bootmem: remove the vmemmap pages from kmemleak in
+put_page_bootmem") fix an overlaps existing problem of kmemleak.  But the
+problem still existed when HAVE_BOOTMEM_INFO_NODE is disabled, because in
+this case, free_bootmem_page() will call free_reserved_page() directly.
+
+Fix the problem by adding kmemleak_free_part() in free_bootmem_page() when
+HAVE_BOOTMEM_INFO_NODE is disabled.
+
+Link: https://lkml.kernel.org/r/20230704101942.2819426-1-liushixin2@huawei.com
+Fixes: f41f2ed43ca5 ("mm: hugetlb: free the vmemmap pages associated with each HugeTLB page")
+Signed-off-by: Liu Shixin <liushixin2@huawei.com>
+Acked-by: Muchun Song <songmuchun@bytedance.com>
+Cc: Matthew Wilcox <willy@infradead.org>
+Cc: Mike Kravetz <mike.kravetz@oracle.com>
+Cc: Oscar Salvador <osalvador@suse.de>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/bootmem_info.h |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- 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(unsi
+ static inline void free_bootmem_page(struct page *page)
+ {
++      kmemleak_free_part(page_to_virt(page), PAGE_SIZE);
+       free_reserved_page(page);
+ }
+ #endif
index 38f04ac9b09869c8863ca810aa4da662ac938811..bc4ee94a5b35d41dd9eef4b0228ce179c05bfc1c 100644 (file)
@@ -27,14 +27,12 @@ Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ---
+ drivers/gpu/drm/amd/display/dc/core/dc.c |    3 ---
  1 file changed, 3 deletions(-)
 
-diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
-index 9ec0a343efadb..e6e26fe1be0f8 100644
 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
 +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
-@@ -2540,9 +2540,6 @@ static enum surface_update_type det_surface_update(const struct dc *dc,
+@@ -2526,9 +2526,6 @@ static enum surface_update_type det_surf
        enum surface_update_type overall_type = UPDATE_TYPE_FAST;
        union surface_update_flags *update_flags = &u->surface->update_flags;
  
@@ -44,6 +42,3 @@ index 9ec0a343efadb..e6e26fe1be0f8 100644
        if (!is_surface_in_context(context, u->surface) || u->surface->force_full_update) {
                update_flags->raw = 0xFFFFFFFF;
                return UPDATE_TYPE_FULL;
--- 
-2.39.2
-
diff --git a/queue-6.3/mm-call-arch_swap_restore-from-do_swap_page.patch b/queue-6.3/mm-call-arch_swap_restore-from-do_swap_page.patch
new file mode 100644 (file)
index 0000000..1c5b4c3
--- /dev/null
@@ -0,0 +1,48 @@
+From 6dca4ac6fc91fd41ea4d6c4511838d37f4e0eab2 Mon Sep 17 00:00:00 2001
+From: Peter Collingbourne <pcc@google.com>
+Date: Mon, 22 May 2023 17:43:08 -0700
+Subject: mm: call arch_swap_restore() from do_swap_page()
+
+From: Peter Collingbourne <pcc@google.com>
+
+commit 6dca4ac6fc91fd41ea4d6c4511838d37f4e0eab2 upstream.
+
+Commit c145e0b47c77 ("mm: streamline COW logic in do_swap_page()") moved
+the call to swap_free() before the call to set_pte_at(), which meant that
+the MTE tags could end up being freed before set_pte_at() had a chance to
+restore them.  Fix it by adding a call to the arch_swap_restore() hook
+before the call to swap_free().
+
+Link: https://lkml.kernel.org/r/20230523004312.1807357-2-pcc@google.com
+Link: https://linux-review.googlesource.com/id/I6470efa669e8bd2f841049b8c61020c510678965
+Fixes: c145e0b47c77 ("mm: streamline COW logic in do_swap_page()")
+Signed-off-by: Peter Collingbourne <pcc@google.com>
+Reported-by: Qun-wei Lin <Qun-wei.Lin@mediatek.com>
+Closes: https://lore.kernel.org/all/5050805753ac469e8d727c797c2218a9d780d434.camel@mediatek.com/
+Acked-by: David Hildenbrand <david@redhat.com>
+Acked-by: "Huang, Ying" <ying.huang@intel.com>
+Reviewed-by: Steven Price <steven.price@arm.com>
+Acked-by: Catalin Marinas <catalin.marinas@arm.com>
+Cc: <stable@vger.kernel.org>   [6.1+]
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ mm/memory.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/mm/memory.c
++++ b/mm/memory.c
+@@ -3915,6 +3915,13 @@ vm_fault_t do_swap_page(struct vm_fault
+       }
+       /*
++       * 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
+        * yet.
index 1b6fd0470fb608faf40e1014f9d1fe4677a2e0b9..e7ac03cee9679c1f34d2ce7ed5cff8b08503e8b7 100644 (file)
@@ -1,3 +1,4 @@
+mm-call-arch_swap_restore-from-do_swap_page.patch
 drm-use-mgr-dev-in-drm_dbg_kms-in-drm_dp_add_payload_part2.patch
 fs-pipe-reveal-missing-function-protoypes.patch
 block-fix-the-type-of-the-second-bdev_op_is_zoned_wr.patch
@@ -163,6 +164,7 @@ drm-amd-display-add-logging-for-display-mall-refresh.patch
 drm-amd-display-fix-is_timing_changed-prototype.patch
 radeon-avoid-double-free-in-ci_dpm_init.patch
 drm-amd-display-explicitly-specify-update-type-per-p.patch
+bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch
 drm-i915-guc-more-debug-print-updates-guc-slpc.patch
 drm-i915-guc-slpc-provide-sysfs-for-efficient-freq.patch
 drm-bridge-it6505-move-a-variable-assignment-behind-.patch