summaryrefslogtreecommitdiff
path: root/sys-kernel/cairn-sources/files/5.10.8/hardened-patches/0043-mark-slub-runtime-configuration-as-__ro_after_init.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/cairn-sources/files/5.10.8/hardened-patches/0043-mark-slub-runtime-configuration-as-__ro_after_init.patch')
-rw-r--r--sys-kernel/cairn-sources/files/5.10.8/hardened-patches/0043-mark-slub-runtime-configuration-as-__ro_after_init.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/sys-kernel/cairn-sources/files/5.10.8/hardened-patches/0043-mark-slub-runtime-configuration-as-__ro_after_init.patch b/sys-kernel/cairn-sources/files/5.10.8/hardened-patches/0043-mark-slub-runtime-configuration-as-__ro_after_init.patch
new file mode 100644
index 000000000000..c28f3ed7a896
--- /dev/null
+++ b/sys-kernel/cairn-sources/files/5.10.8/hardened-patches/0043-mark-slub-runtime-configuration-as-__ro_after_init.patch
@@ -0,0 +1,57 @@
+From 732f4c3f1f0c80bbd82e81be30f3625850e6ced3 Mon Sep 17 00:00:00 2001
+From: Daniel Micay <danielmicay@gmail.com>
+Date: Sun, 14 May 2017 19:01:58 -0400
+Subject: [PATCH 043/113] mark slub runtime configuration as __ro_after_init
+
+Signed-off-by: Daniel Micay <danielmicay@gmail.com>
+---
+ mm/slub.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/mm/slub.c b/mm/slub.c
+index 34dcc09e2ec9..3ef79a1878ed 100644
+--- a/mm/slub.c
++++ b/mm/slub.c
+@@ -486,13 +486,13 @@ static inline void *restore_red_left(struct kmem_cache *s, void *p)
+ * Debug settings:
+ */
+ #if defined(CONFIG_SLUB_DEBUG_ON)
+-static slab_flags_t slub_debug = DEBUG_DEFAULT_FLAGS;
++static slab_flags_t slub_debug __ro_after_init = DEBUG_DEFAULT_FLAGS;
+ #else
+-static slab_flags_t slub_debug;
++static slab_flags_t slub_debug __ro_after_init;
+ #endif
+
+-static char *slub_debug_string;
+-static int disable_higher_order_debug;
++static char *slub_debug_string __ro_after_init;
++static int disable_higher_order_debug __ro_after_init;
+
+ /*
+ * slub is about to manipulate internal object metadata. This memory lies
+@@ -3363,9 +3363,9 @@ EXPORT_SYMBOL(kmem_cache_alloc_bulk);
+ * and increases the number of allocations possible without having to
+ * take the list_lock.
+ */
+-static unsigned int slub_min_order;
+-static unsigned int slub_max_order = PAGE_ALLOC_COSTLY_ORDER;
+-static unsigned int slub_min_objects;
++static unsigned int slub_min_order __ro_after_init;
++static unsigned int slub_max_order __ro_after_init = PAGE_ALLOC_COSTLY_ORDER;
++static unsigned int slub_min_objects __ro_after_init;
+
+ /*
+ * Calculate the order of allocation given an slab object size.
+@@ -4883,7 +4883,7 @@ enum slab_stat_type {
+ #define SO_TOTAL (1 << SL_TOTAL)
+
+ #ifdef CONFIG_MEMCG
+-static bool memcg_sysfs_enabled = IS_ENABLED(CONFIG_SLUB_MEMCG_SYSFS_ON);
++static bool memcg_sysfs_enabled __ro_after_init = IS_ENABLED(CONFIG_SLUB_MEMCG_SYSFS_ON);
+
+ static int __init setup_slub_memcg_sysfs(char *str)
+ {
+--
+2.30.0
+