diff mbox series

[10/12] sysctl: Move sysctl_panic_on_stackoverflow to kernel/panic.c

Message ID 20250509-jag-mv_ctltables_iter2-v1-10-d0ad83f5f4c3@kernel.org
State New
Headers show
Series sysctl: Move sysctls to their respective subsystems (second batch) | expand

Commit Message

Joel Granados May 9, 2025, 12:54 p.m. UTC
This is part of a greater effort to move ctl tables into their
respective subsystems which will reduce the merge conflicts in
kernel/sysctl.c.

Signed-off-by: Joel Granados <joel.granados@kernel.org>
---
 kernel/panic.c  | 10 ++++++++++
 kernel/sysctl.c | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

Comments

Kees Cook May 9, 2025, 5:04 p.m. UTC | #1
On Fri, May 09, 2025 at 02:54:14PM +0200, Joel Granados wrote:
> This is part of a greater effort to move ctl tables into their
> respective subsystems which will reduce the merge conflicts in
> kernel/sysctl.c.
> 
> Signed-off-by: Joel Granados <joel.granados@kernel.org>

Another undocumented sysctl. ;) This one should be called
"panic_on_stack_exhaustion", but so be it. :)

Reviewed-by: Kees Cook <kees@kernel.org>

> ---
>  kernel/panic.c  | 10 ++++++++++
>  kernel/sysctl.c | 10 ----------
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 213c6c9d6a750ff3d17f3cf530b37c619cd816f4..401f0997f654797acc3351040bbbda1845ce00c1 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -183,6 +183,16 @@ static const struct ctl_table kern_panic_table[] = {
>  		.mode           = 0644,
>  		.proc_handler   = proc_douintvec,
>  	},
> +#if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
> +	defined(CONFIG_DEBUG_STACKOVERFLOW)
> +	{
> +		.procname	= "panic_on_stackoverflow",
> +		.data		= &sysctl_panic_on_stackoverflow,
> +		.maxlen		= sizeof(int),
> +		.mode		= 0644,
> +		.proc_handler	= proc_dointvec,
> +	},
> +#endif
>  };
>  
>  static __init int kernel_panic_sysctls_init(void)
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index d5bebdd02cd4f1def7d9dd2b85454a9022b600b7..446d77ec44f57a4929389b64fc23d3b180f550b4 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -1552,16 +1552,6 @@ static const struct ctl_table kern_table[] = {
>  		.mode		= 0444,
>  		.proc_handler	= proc_dointvec,
>  	},
> -#if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
> -	defined(CONFIG_DEBUG_STACKOVERFLOW)
> -	{
> -		.procname	= "panic_on_stackoverflow",
> -		.data		= &sysctl_panic_on_stackoverflow,
> -		.maxlen		= sizeof(int),
> -		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> -	},
> -#endif
>  #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
>  	{
>  		.procname	= "ignore-unaligned-usertrap",
> 
> -- 
> 2.47.2
> 
>
diff mbox series

Patch

diff --git a/kernel/panic.c b/kernel/panic.c
index 213c6c9d6a750ff3d17f3cf530b37c619cd816f4..401f0997f654797acc3351040bbbda1845ce00c1 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -183,6 +183,16 @@  static const struct ctl_table kern_panic_table[] = {
 		.mode           = 0644,
 		.proc_handler   = proc_douintvec,
 	},
+#if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
+	defined(CONFIG_DEBUG_STACKOVERFLOW)
+	{
+		.procname	= "panic_on_stackoverflow",
+		.data		= &sysctl_panic_on_stackoverflow,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec,
+	},
+#endif
 };
 
 static __init int kernel_panic_sysctls_init(void)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index d5bebdd02cd4f1def7d9dd2b85454a9022b600b7..446d77ec44f57a4929389b64fc23d3b180f550b4 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1552,16 +1552,6 @@  static const struct ctl_table kern_table[] = {
 		.mode		= 0444,
 		.proc_handler	= proc_dointvec,
 	},
-#if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
-	defined(CONFIG_DEBUG_STACKOVERFLOW)
-	{
-		.procname	= "panic_on_stackoverflow",
-		.data		= &sysctl_panic_on_stackoverflow,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
-	},
-#endif
 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
 	{
 		.procname	= "ignore-unaligned-usertrap",