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-next>] [day] [month] [year] [list]
Message-Id: <20211001125513.cf40fa1a3188416582666f66@kernel.org>
Date:   Fri, 1 Oct 2021 12:55:13 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Beau Belgrave <beaub@...ux.microsoft.com>
Cc:     linux-trace-devel@...R.KERNEL.ORG, rostedt@...dmis.org,
        zanussi@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] synth_events: Do not block other dyn_event systems
 during create

Hi Beau,

On Thu, 30 Sep 2021 15:38:21 -0700
Beau Belgrave <beaub@...ux.microsoft.com> wrote:

> synth_events is returning -EINVAL if the dyn_event create command does
> not contain ' \t'. This prevents other systems from getting called back.
> synth_events needs to return -ECANCELED in these cases when the command
> is not targeting the synth_event system.

Thanks for clean up the synthetic event!
This looks good to me.

Reviewed-by: Masami Hiramatsu <mhiramat@...nel.org>

So now are you trying to reuse synth event for user event?
Then I think you need to register a new dyn_event ops so
that histogram will not submit the event.

BTW, how do you filter an event written by a user process?
Will you add an array of event id for the file data structure?

Thank you,

> 
> Signed-off-by: Beau Belgrave <beaub@...ux.microsoft.com>
> ---
>  kernel/trace/trace_events_synth.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
> index 9315fc03e303..08b7ea639cea 100644
> --- a/kernel/trace/trace_events_synth.c
> +++ b/kernel/trace/trace_events_synth.c
> @@ -2051,6 +2051,13 @@ static int create_synth_event(const char *raw_command)
>  
>  	last_cmd_set(raw_command);
>  
> +	name = raw_command;
> +
> +	/* Don't try to process if not our system */
> +	if (name[0] != 's' || name[1] != ':')
> +		return -ECANCELED;
> +	name += 2;
> +
>  	p = strpbrk(raw_command, " \t");
>  	if (!p) {
>  		synth_err(SYNTH_ERR_INVALID_CMD, 0);
> @@ -2059,12 +2066,6 @@ static int create_synth_event(const char *raw_command)
>  
>  	fields = skip_spaces(p);
>  
> -	name = raw_command;
> -
> -	if (name[0] != 's' || name[1] != ':')
> -		return -ECANCELED;
> -	name += 2;
> -
>  	/* This interface accepts group name prefix */
>  	if (strchr(name, '/')) {
>  		len = str_has_prefix(name, SYNTH_SYSTEM "/");
> -- 
> 2.17.1
> 


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ