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: <20230113230406.6a8cd992@gandalf.local.home>
Date:   Fri, 13 Jan 2023 23:04:06 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Ross Zwisler <zwisler@...gle.com>
Cc:     linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 4/4] tracing: Allow boot instances to have snapshot
 buffers

On Fri, 13 Jan 2023 17:08:09 -0700
Ross Zwisler <zwisler@...gle.com> wrote:

> > +++ b/kernel/trace/trace.c
> > @@ -192,6 +192,9 @@ static bool snapshot_at_boot;
> >  static char boot_instance_info[COMMAND_LINE_SIZE] __initdata;
> >  static int boot_instance_index;
> >  
> > +static char boot_snapshot_info[COMMAND_LINE_SIZE] __initdata;  
> 
> For x86 machines at least COMMAND_LINE_SIZE is pretty big (2048), so between
> boot_instance_info and boot_snapshot_info we are using an entire 4k of memory.
> It seems unlikely that any user would need a string this long for these
> options.  Should we trim this down to something smaller?

They are both empty (BSS) and initdata. So they get allocated at boot up
and freed at the end of boot.

> 
> > +static int boot_snapshot_index;
> > +
> >  static int __init set_cmdline_ftrace(char *str)
> >  {
> >  	strlcpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
> > @@ -228,9 +231,22 @@ __setup("traceoff_on_warning", stop_trace_on_warning);
> >  
> >  static int __init boot_alloc_snapshot(char *str)
> >  {
> > -	allocate_snapshot = true;
> > -	/* We also need the main ring buffer expanded */
> > -	ring_buffer_expanded = true;
> > +	char *slot = boot_snapshot_info + boot_snapshot_index;
> > +	int left = COMMAND_LINE_SIZE - boot_snapshot_index;  
> 
> sizeof(boot_snapshot_info) is a bit safer than COMMAND_LINE_SIZE so they don't
> get out of sync, plus we may also want to shrink it a bit as mentioned above.

Yeah, I'm willing to do this (as mentioned before).

> 
> Just two nits, other than that you can add:
> 
> Reviewed-by: Ross Zwisler <zwisler@...gle.com>

Thanks!

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ