]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Drop kho-fix-kasan-support-for-restored-vmalloc-regions.patch
authorSasha Levin <sashal@kernel.org>
Mon, 18 May 2026 13:24:47 +0000 (09:24 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 18 May 2026 13:24:47 +0000 (09:24 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.18/kho-fix-kasan-support-for-restored-vmalloc-regions.patch [deleted file]
queue-6.18/series
queue-7.0/kho-fix-kasan-support-for-restored-vmalloc-regions.patch [deleted file]
queue-7.0/series

diff --git a/queue-6.18/kho-fix-kasan-support-for-restored-vmalloc-regions.patch b/queue-6.18/kho-fix-kasan-support-for-restored-vmalloc-regions.patch
deleted file mode 100644 (file)
index c6c4123..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-From 5fd825899f17e319378c847cfe4295abb3bdfebd Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 25 Feb 2026 17:38:57 -0500
-Subject: kho: fix KASAN support for restored vmalloc regions
-
-From: Pasha Tatashin <pasha.tatashin@soleen.com>
-
-[ Upstream commit 019fc36872374db6fd35e118c9e935374404bfbf ]
-
-Restored vmalloc regions are currently not properly marked for KASAN,
-causing KASAN to treat accesses to these regions as out-of-bounds.
-
-Fix this by properly unpoisoning the restored vmalloc area using
-kasan_unpoison_vmalloc().  This requires setting the VM_UNINITIALIZED flag
-during the initial area allocation and clearing it after the pages have
-been mapped and unpoisoned, using the clear_vm_uninitialized_flag()
-helper.
-
-Link: https://lkml.kernel.org/r/20260225223857.1714801-3-pasha.tatashin@soleen.com
-Fixes: a667300bd53f ("kho: add support for preserving vmalloc allocations")
-Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
-Reported-by: Pratyush Yadav <pratyush@kernel.org>
-Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
-Tested-by: Pratyush Yadav (Google) <pratyush@kernel.org>
-Cc: Alexander Graf <graf@amazon.com>
-Cc: Liam Howlett <liam.howlett@oracle.com>
-Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
-Cc: Michal Hocko <mhocko@suse.com>
-Cc: Mike Rapoport <rppt@kernel.org>
-Cc: Suren Baghdasaryan <surenb@google.com>
-Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- kernel/kexec_handover.c | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/kernel/kexec_handover.c b/kernel/kexec_handover.c
-index c13b99f7c9891..2ec4c3bcec128 100644
---- a/kernel/kexec_handover.c
-+++ b/kernel/kexec_handover.c
-@@ -11,6 +11,7 @@
- #include <linux/cleanup.h>
- #include <linux/cma.h>
- #include <linux/count_zeros.h>
-+#include <linux/kasan.h>
- #include <linux/kexec.h>
- #include <linux/kexec_handover.h>
- #include <linux/libfdt.h>
-@@ -957,6 +958,7 @@ EXPORT_SYMBOL_GPL(kho_preserve_vmalloc);
- void *kho_restore_vmalloc(const struct kho_vmalloc *preservation)
- {
-       struct kho_vmalloc_chunk *chunk = KHOSER_LOAD_PTR(preservation->first);
-+      kasan_vmalloc_flags_t kasan_flags = KASAN_VMALLOC_PROT_NORMAL;
-       unsigned int align, order, shift, vm_flags;
-       unsigned long total_pages, contig_pages;
-       unsigned long addr, size;
-@@ -1008,7 +1010,8 @@ void *kho_restore_vmalloc(const struct kho_vmalloc *preservation)
-               goto err_free_pages_array;
-       area = __get_vm_area_node(total_pages * PAGE_SIZE, align, shift,
--                                vm_flags, VMALLOC_START, VMALLOC_END,
-+                                vm_flags | VM_UNINITIALIZED,
-+                                VMALLOC_START, VMALLOC_END,
-                                 NUMA_NO_NODE, GFP_KERNEL,
-                                 __builtin_return_address(0));
-       if (!area)
-@@ -1023,6 +1026,13 @@ void *kho_restore_vmalloc(const struct kho_vmalloc *preservation)
-       area->nr_pages = total_pages;
-       area->pages = pages;
-+      if (vm_flags & VM_ALLOC)
-+              kasan_flags |= KASAN_VMALLOC_VM_ALLOC;
-+
-+      area->addr = kasan_unpoison_vmalloc(area->addr, total_pages * PAGE_SIZE,
-+                                          kasan_flags);
-+      clear_vm_uninitialized_flag(area);
-+
-       return area->addr;
- err_free_vm_area:
--- 
-2.53.0
-
index 2bff64768c496cb9809b855a25240dcb50221a47..5d0c3d2220e083ec41f832632bbb695e54a0d3a1 100644 (file)
@@ -309,7 +309,6 @@ gpu-nova-core-bitfield-move-bitfield-specific-code-f.patch
 gpu-nova-core-bitfield-fix-broken-default-implementa.patch
 selftests-mm-skip-migration-tests-if-numa-is-unavail.patch
 kho-make-debugfs-interface-optional.patch
-kho-fix-kasan-support-for-restored-vmalloc-regions.patch
 documentation-fix-a-hugetlbfs-reservation-statement.patch
 selftest-memcg-skip-memcg_sock-test-if-address-famil.patch
 alsa-scarlett2-add-missing-sentinel-initializer-fiel.patch
diff --git a/queue-7.0/kho-fix-kasan-support-for-restored-vmalloc-regions.patch b/queue-7.0/kho-fix-kasan-support-for-restored-vmalloc-regions.patch
deleted file mode 100644 (file)
index 94fa618..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-From 03827d524d7732d238d448274702baef3b5cb916 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 25 Feb 2026 17:38:57 -0500
-Subject: kho: fix KASAN support for restored vmalloc regions
-
-From: Pasha Tatashin <pasha.tatashin@soleen.com>
-
-[ Upstream commit 019fc36872374db6fd35e118c9e935374404bfbf ]
-
-Restored vmalloc regions are currently not properly marked for KASAN,
-causing KASAN to treat accesses to these regions as out-of-bounds.
-
-Fix this by properly unpoisoning the restored vmalloc area using
-kasan_unpoison_vmalloc().  This requires setting the VM_UNINITIALIZED flag
-during the initial area allocation and clearing it after the pages have
-been mapped and unpoisoned, using the clear_vm_uninitialized_flag()
-helper.
-
-Link: https://lkml.kernel.org/r/20260225223857.1714801-3-pasha.tatashin@soleen.com
-Fixes: a667300bd53f ("kho: add support for preserving vmalloc allocations")
-Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
-Reported-by: Pratyush Yadav <pratyush@kernel.org>
-Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
-Tested-by: Pratyush Yadav (Google) <pratyush@kernel.org>
-Cc: Alexander Graf <graf@amazon.com>
-Cc: Liam Howlett <liam.howlett@oracle.com>
-Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
-Cc: Michal Hocko <mhocko@suse.com>
-Cc: Mike Rapoport <rppt@kernel.org>
-Cc: Suren Baghdasaryan <surenb@google.com>
-Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- kernel/liveupdate/kexec_handover.c | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
-index 479c42e08b74a..1ed8913c5e2c0 100644
---- a/kernel/liveupdate/kexec_handover.c
-+++ b/kernel/liveupdate/kexec_handover.c
-@@ -13,6 +13,7 @@
- #include <linux/cma.h>
- #include <linux/kmemleak.h>
- #include <linux/count_zeros.h>
-+#include <linux/kasan.h>
- #include <linux/kexec.h>
- #include <linux/kexec_handover.h>
- #include <linux/kho/abi/kexec_handover.h>
-@@ -1082,6 +1083,7 @@ EXPORT_SYMBOL_GPL(kho_unpreserve_vmalloc);
- void *kho_restore_vmalloc(const struct kho_vmalloc *preservation)
- {
-       struct kho_vmalloc_chunk *chunk = KHOSER_LOAD_PTR(preservation->first);
-+      kasan_vmalloc_flags_t kasan_flags = KASAN_VMALLOC_PROT_NORMAL;
-       unsigned int align, order, shift, vm_flags;
-       unsigned long total_pages, contig_pages;
-       unsigned long addr, size;
-@@ -1133,7 +1135,8 @@ void *kho_restore_vmalloc(const struct kho_vmalloc *preservation)
-               goto err_free_pages_array;
-       area = __get_vm_area_node(total_pages * PAGE_SIZE, align, shift,
--                                vm_flags, VMALLOC_START, VMALLOC_END,
-+                                vm_flags | VM_UNINITIALIZED,
-+                                VMALLOC_START, VMALLOC_END,
-                                 NUMA_NO_NODE, GFP_KERNEL,
-                                 __builtin_return_address(0));
-       if (!area)
-@@ -1148,6 +1151,13 @@ void *kho_restore_vmalloc(const struct kho_vmalloc *preservation)
-       area->nr_pages = total_pages;
-       area->pages = pages;
-+      if (vm_flags & VM_ALLOC)
-+              kasan_flags |= KASAN_VMALLOC_VM_ALLOC;
-+
-+      area->addr = kasan_unpoison_vmalloc(area->addr, total_pages * PAGE_SIZE,
-+                                          kasan_flags);
-+      clear_vm_uninitialized_flag(area);
-+
-       return area->addr;
- err_free_vm_area:
--- 
-2.53.0
-
index 16ae5985971d5d0eea3627eff57fd8b149269889..c71b86957cf3a7bffcbefcadcd08c1c37f9ab087 100644 (file)
@@ -396,7 +396,6 @@ dt-bindings-pci-imx6q-pcie-fix-maxitems-of-clocks-an.patch
 pci-mediatek-gen3-prevent-leaking-irq-domains-when-i.patch
 gpu-nova-core-bitfield-fix-broken-default-implementa.patch
 selftests-mm-skip-migration-tests-if-numa-is-unavail.patch
-kho-fix-kasan-support-for-restored-vmalloc-regions.patch
 documentation-fix-a-hugetlbfs-reservation-statement.patch
 docs-admin-guide-mm-damn-lru_sort-fix-intervals-auto.patch
 docs-mm-damon-index-fix-typo-autoamted-automated.patch