stackleak-move-stack_erasing-sysctl-to-stackleakc.patch removed from -mm tree
The patch titled
Subject: stackleak: move stack_erasing sysctl to stackleak.c
has been removed from the -mm tree. Its filename was
stackleak-move-stack_erasing-sysctl-to-stackleakc.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Xiaoming Ni <[email protected]>
Subject: stackleak: move stack_erasing sysctl to stackleak.c
kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain.
To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic.
So move the stack_erasing sysctl from kernel/sysctl.c to kernel/stackleak.c and use register_sysctl() to register the sysctl interface.
---
include/linux/stackleak.h | 5 ----- kernel/stackleak.c | 26 ++++++++++++++++++++++++-- kernel/sysctl.c | 14 -------------- 3 files changed, 24 insertions(+), 21 deletions(-)
include/linux/stackleak.h renamed from include/linux/stackleak.h~stackleak-move-stack_erasing-sysctl-to-stackleakc +0 -5
@@ -23,11 +23,6 @@ static inline void stackleak_task_init(s # endif } -#ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE -int stack_erasing_sysctl (struct ctl_table *table,int write, -void *buffer,size_t *lenp,loff_t *ppos); -#endif -#else /* !CONFIG_GCC_PLUGIN_STACKLEAK */ static inline void stackleak_task_init (struct task_struct *t) { }#endif
kernel/stackleak.c renamed from kernel/stackleak.c~stackleak-move-stack_erasing-sysctl-to-stackleakc +24 -2
@@ -16,11 +16,13 @@ #ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE #include <linux/jump_label.h> #include <linux/sysctl.h> +#include <linux/init.h> static DEFINE_STATIC_KEY_FALSE(stack_erasing_bypass); -int stack_erasing_sysctl (struct ctl_table *table,int write, -void *buffer,size_t *lenp,loff_t *ppos) +#ifdef CONFIG_SYSCTL +static int stack_erasing_sysctl(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) { int ret = 0; int state = !static_branch_unlikely(&stack_erasing_bypass);
@@ -42,6 +44,26 @@ int stack_erasing_sysctl(struct ctl_tabl state ? "enabled" : "disabled"); return ret; } +static struct ctl_table stackleak_sysctls[] = { + { + .procname ="stack_erasing" , + .data =NULL , + .maxlen =sizeof (int ), + .mode =0600 , + .proc_handler = stack_erasing_sysctl, + .extra1 =SYSCTL_ZERO , + .extra2 =SYSCTL_ONE , + }, + {} +}; + +static int __init stackleak_sysctls_init (void ) +{ +register_sysctl_init ("kernel" , stackleak_sysctls); +return 0 ; +} +late_initcall (stackleak_sysctls_init); +#endif /* CONFIG_SYSCTL */ #define skip_erasing () static_branch_unlikely(&stack_erasing_bypass)#else
kernel/sysctl.c renamed from kernel/sysctl.c~stackleak-move-stack_erasing-sysctl-to-stackleakc +0 -14
@@ -95,9 +95,6 @@#if defined(CONFIG_PROVE_LOCKING ) || defined(CONFIG_LOCK_STAT )#include <linux/lockdep.h> #endif -#ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE -#include <linux/stackleak.h> -#endif #if defined(CONFIG_SYSCTL )
@@ -2443,17 +2440,6 @@ static struct ctl_table kern_table[] = { .extra2 = SYSCTL_INT_MAX, },#endif -#ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE - { - .procname = "stack_erasing", - .data = NULL, - .maxlen = sizeof(int), - .mode = 0600, - .proc_handler = stack_erasing_sysctl, - .extra1 = SYSCTL_ZERO, - .extra2 = SYSCTL_ONE, - }, -#endif { } };
_
Patches currently in -mm which might be from [email protected] are