lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <zeijhrq5umjjiectrpbuebdnnwrdaqjoxd3aonhkesxj6a3pgi@mmqoadbqoh4n>
Date: Thu, 13 Mar 2025 17:19:06 +0100
From: Joel Granados <joel.granados@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Kees Cook <kees@...nel.org>, Masami Hiramatsu <mhiramat@...nel.org>, 
	Mark Rutland <mark.rutland@....com>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, 
	"David S. Miller" <davem@...emloft.net>, Andreas Larsson <andreas@...sler.com>, 
	Heiko Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>, 
	Alexander Gordeev <agordeev@...ux.ibm.com>, Christian Borntraeger <borntraeger@...ux.ibm.com>, 
	Sven Schnelle <svens@...ux.ibm.com>, Gerald Schaefer <gerald.schaefer@...ux.ibm.com>, 
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org, 
	linux-trace-kernel@...r.kernel.org, sparclinux@...r.kernel.org, linux-s390@...r.kernel.org
Subject: Re: [PATCH v2 4/6] stack_tracer: move sysctl registration to
 kernel/trace/trace_stack.c

On Thu, Mar 06, 2025 at 10:31:38AM -0500, Steven Rostedt wrote:
> On Thu, 06 Mar 2025 12:29:44 +0100
> Joel Granados <joel.granados@...nel.org> wrote:
> 
> > Move stack_tracer_enabled into trace_stack_sysctl_table. This is part of
> > a greater effort to move ctl tables into their respective subsystems
> > which will reduce the merge conflicts in kerenel/sysctl.c.
> > 
> > Signed-off-by: Joel Granados <joel.granados@...nel.org>
> > ---
> >  kernel/sysctl.c            | 10 ----------
> >  kernel/trace/trace_stack.c | 20 ++++++++++++++++++++
> >  2 files changed, 20 insertions(+), 10 deletions(-)
> > 
> > diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> > index baa250e223a26bafc39cb7a7d7635b4f7f5dcf56..dc3747cc72d470662879e4f2b7f2651505b7ca90 100644
> > --- a/kernel/sysctl.c
> > +++ b/kernel/sysctl.c
> > @@ -68,7 +68,6 @@
> >  
> >  #ifdef CONFIG_X86
> >  #include <asm/nmi.h>
> > -#include <asm/stacktrace.h>
> >  #include <asm/io.h>
> >  #endif
> >  #ifdef CONFIG_SPARC
> > @@ -1674,15 +1673,6 @@ static const struct ctl_table kern_table[] = {
> >  		.proc_handler	= proc_dointvec,
> >  	},
> >  #endif
> > -#ifdef CONFIG_STACK_TRACER
> > -	{
> > -		.procname	= "stack_tracer_enabled",
> > -		.data		= &stack_tracer_enabled,
> > -		.maxlen		= sizeof(int),
> > -		.mode		= 0644,
> > -		.proc_handler	= stack_trace_sysctl,
> > -	},
> > -#endif
> >  #ifdef CONFIG_MODULES
> >  	{
> >  		.procname	= "modprobe",
> > diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
> > index 14c6f272c4d8a382070d45e1cf0ee97db38831c9..b7ffbc1da8357f9c252cb8936c8f789daa97eb9a 100644
> > --- a/kernel/trace/trace_stack.c
> > +++ b/kernel/trace/trace_stack.c
> > @@ -578,3 +578,23 @@ static __init int stack_trace_init(void)
> >  }
> >  
> >  device_initcall(stack_trace_init);
> > +
> > +
> > +static const struct ctl_table trace_stack_sysctl_table[] = {
> > +	{
> > +		.procname	= "stack_tracer_enabled",
> > +		.data		= &stack_tracer_enabled,
> > +		.maxlen		= sizeof(int),
> > +		.mode		= 0644,
> > +		.proc_handler	= stack_trace_sysctl,
> > +	},
> > +};
> > +
> > +static int __init init_trace_stack_sysctls(void)
> > +{
> > +	register_sysctl_init("kernel", trace_stack_sysctl_table);
> > +	return 0;
> > +}
> > +subsys_initcall(init_trace_stack_sysctls);
> > +
> > +
> > 
> 
> This should also make the variable "stack_tracer_enabled" static and
> removed from the ftrace.h header.
oops, my bad. just sent out V3.

Thx
Best

-- 

Joel Granados

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ