From: Greg Kroah-Hartman Date: Thu, 19 Jun 2025 04:07:40 +0000 (+0200) Subject: drop queue-6.15/revert-mm-execmem-unify-early-execmem_cache-behaviour.patch X-Git-Tag: v6.6.94~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3397d4c4df33f3f0eb3e4c79825e77bad4bdb1f;p=thirdparty%2Fkernel%2Fstable-queue.git drop queue-6.15/revert-mm-execmem-unify-early-execmem_cache-behaviour.patch Not ready for it yet... --- diff --git a/queue-6.15/revert-mm-execmem-unify-early-execmem_cache-behaviour.patch b/queue-6.15/revert-mm-execmem-unify-early-execmem_cache-behaviour.patch deleted file mode 100644 index f74c1bfcb6..0000000000 --- a/queue-6.15/revert-mm-execmem-unify-early-execmem_cache-behaviour.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 7cd9a11dd0c3d1dd225795ed1b5b53132888e7b5 Mon Sep 17 00:00:00 2001 -From: "Mike Rapoport (Microsoft)" -Date: Tue, 3 Jun 2025 14:14:45 +0300 -Subject: Revert "mm/execmem: Unify early execmem_cache behaviour" - -From: Mike Rapoport (Microsoft) - -commit 7cd9a11dd0c3d1dd225795ed1b5b53132888e7b5 upstream. - -The commit d6d1e3e6580c ("mm/execmem: Unify early execmem_cache -behaviour") changed early behaviour of execemem ROX cache to allow its -usage in early x86 code that allocates text pages when -CONFIG_MITGATION_ITS is enabled. - -The permission management of the pages allocated from execmem for ITS -mitigation is now completely contained in arch/x86/kernel/alternatives.c -and therefore there is no need to special case early allocations in -execmem. - -This reverts commit d6d1e3e6580ca35071ad474381f053cbf1fb6414. - -Signed-off-by: Mike Rapoport (Microsoft) -Signed-off-by: Peter Zijlstra (Intel) -Cc: stable@vger.kernel.org -Link: https://lkml.kernel.org/r/20250603111446.2609381-6-rppt@kernel.org -Signed-off-by: Greg Kroah-Hartman ---- - arch/x86/mm/init_32.c | 3 --- - arch/x86/mm/init_64.c | 3 --- - include/linux/execmem.h | 8 +------- - mm/execmem.c | 40 +++------------------------------------- - 4 files changed, 4 insertions(+), 50 deletions(-) - ---- a/arch/x86/mm/init_32.c -+++ b/arch/x86/mm/init_32.c -@@ -30,7 +30,6 @@ - #include - #include - #include --#include - - #include - #include -@@ -756,8 +755,6 @@ void mark_rodata_ro(void) - pr_info("Write protecting kernel text and read-only data: %luk\n", - size >> 10); - -- execmem_cache_make_ro(); -- - kernel_set_to_readonly = 1; - - #ifdef CONFIG_CPA_DEBUG ---- a/arch/x86/mm/init_64.c -+++ b/arch/x86/mm/init_64.c -@@ -34,7 +34,6 @@ - #include - #include - #include --#include - - #include - #include -@@ -1392,8 +1391,6 @@ void mark_rodata_ro(void) - (end - start) >> 10); - set_memory_ro(start, (end - start) >> PAGE_SHIFT); - -- execmem_cache_make_ro(); -- - kernel_set_to_readonly = 1; - - /* ---- a/include/linux/execmem.h -+++ b/include/linux/execmem.h -@@ -54,7 +54,7 @@ enum execmem_range_flags { - EXECMEM_ROX_CACHE = (1 << 1), - }; - --#if defined(CONFIG_ARCH_HAS_EXECMEM_ROX) && defined(CONFIG_EXECMEM) -+#ifdef CONFIG_ARCH_HAS_EXECMEM_ROX - /** - * execmem_fill_trapping_insns - set memory to contain instructions that - * will trap -@@ -94,15 +94,9 @@ int execmem_make_temp_rw(void *ptr, size - * Return: 0 on success or negative error code on failure. - */ - int execmem_restore_rox(void *ptr, size_t size); -- --/* -- * Called from mark_readonly(), where the system transitions to ROX. -- */ --void execmem_cache_make_ro(void); - #else - static inline int execmem_make_temp_rw(void *ptr, size_t size) { return 0; } - static inline int execmem_restore_rox(void *ptr, size_t size) { return 0; } --static inline void execmem_cache_make_ro(void) { } - #endif - - /** ---- a/mm/execmem.c -+++ b/mm/execmem.c -@@ -254,34 +254,6 @@ out_unlock: - return ptr; - } - --static bool execmem_cache_rox = false; -- --void execmem_cache_make_ro(void) --{ -- struct maple_tree *free_areas = &execmem_cache.free_areas; -- struct maple_tree *busy_areas = &execmem_cache.busy_areas; -- MA_STATE(mas_free, free_areas, 0, ULONG_MAX); -- MA_STATE(mas_busy, busy_areas, 0, ULONG_MAX); -- struct mutex *mutex = &execmem_cache.mutex; -- void *area; -- -- execmem_cache_rox = true; -- -- mutex_lock(mutex); -- -- mas_for_each(&mas_free, area, ULONG_MAX) { -- unsigned long pages = mas_range_len(&mas_free) >> PAGE_SHIFT; -- set_memory_ro(mas_free.index, pages); -- } -- -- mas_for_each(&mas_busy, area, ULONG_MAX) { -- unsigned long pages = mas_range_len(&mas_busy) >> PAGE_SHIFT; -- set_memory_ro(mas_busy.index, pages); -- } -- -- mutex_unlock(mutex); --} -- - static int execmem_cache_populate(struct execmem_range *range, size_t size) - { - unsigned long vm_flags = VM_ALLOW_HUGE_VMAP; -@@ -302,15 +274,9 @@ static int execmem_cache_populate(struct - /* fill memory with instructions that will trap */ - execmem_fill_trapping_insns(p, alloc_size, /* writable = */ true); - -- if (execmem_cache_rox) { -- err = set_memory_rox((unsigned long)p, vm->nr_pages); -- if (err) -- goto err_free_mem; -- } else { -- err = set_memory_x((unsigned long)p, vm->nr_pages); -- if (err) -- goto err_free_mem; -- } -+ err = set_memory_rox((unsigned long)p, vm->nr_pages); -+ if (err) -+ goto err_free_mem; - - err = execmem_cache_add(p, alloc_size); - if (err) diff --git a/queue-6.15/series b/queue-6.15/series index 6e3c0911a0..3b33aade18 100644 --- a/queue-6.15/series +++ b/queue-6.15/series @@ -735,7 +735,6 @@ rust-list-fix-path-of-assert_pinned.patch pidfs-never-refuse-ppid-0-in-pidfd_get_info.patch tools-resolve_btfids-fix-build-when-cross-compiling-kernel-with-clang.patch revert-wifi-mwifiex-fix-ht40-bandwidth-issue.patch -revert-mm-execmem-unify-early-execmem_cache-behaviour.patch alsa-usb-audio-kill-timer-properly-at-removal.patch alsa-usb-audio-add-implicit-feedback-quirk-for-rode-ai-1.patch hid-usbhid-eliminate-recurrent-out-of-bounds-bug-in-usbhid_parse.patch