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: <20230605165245.GA140@W11-BEAU-MD.localdomain>
Date:   Mon, 5 Jun 2023 09:52:45 -0700
From:   Beau Belgrave <beaub@...ux.microsoft.com>
To:     sunliming <sunliming@...inos.cn>
Cc:     mhiramat@...nel.org, rostedt@...dmis.org, shuah@...nel.org,
        linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
        linux-kselftest@...r.kernel.org, kelulanainsley@...il.com
Subject: Re: [PATCH V2 1/4] tracing/user_events: Fix the incorrect trace
 record for empty arguments events

On Mon, Jun 05, 2023 at 03:30:20PM +0800, sunliming wrote:
> The user_events support events that has empty arguments. But the trace event
> is discarded and not really committed when the arguments is empty. Fix this
> by not attempting to copy in zero-length data.
> 
> Signed-off-by: sunliming <sunliming@...inos.cn>
> ---

This series looks good to me, functionally. I applied it locally and ran
this code with the new test additions. Everything works well. Thank you!

The only thing I ask before an ACK is patch 2 and 4 in the series only use
"user_events: " prefix. Can you change these to "selftests/user_events: "?

You marked 3 this way, so I'd like to stick with a consistent form:
I think it would be good going forward we use "tracing/user_events"
for functional changes and "selftests/user_events" for self test
changes.

Thanks,
-Beau

>  kernel/trace/trace_events_user.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c
> index 0d91dac206ff..698703a3d234 100644
> --- a/kernel/trace/trace_events_user.c
> +++ b/kernel/trace/trace_events_user.c
> @@ -1399,7 +1399,7 @@ static void user_event_ftrace(struct user_event *user, struct iov_iter *i,
>  	if (unlikely(!entry))
>  		return;
>  
> -	if (unlikely(!copy_nofault(entry + 1, i->count, i)))
> +	if (unlikely(i->count != 0 && !copy_nofault(entry + 1, i->count, i)))
>  		goto discard;
>  
>  	if (!list_empty(&user->validators) &&
> @@ -1440,7 +1440,7 @@ static void user_event_perf(struct user_event *user, struct iov_iter *i,
>  
>  		perf_fetch_caller_regs(regs);
>  
> -		if (unlikely(!copy_nofault(perf_entry + 1, i->count, i)))
> +		if (unlikely(i->count != 0 && !copy_nofault(perf_entry + 1, i->count, i)))
>  			goto discard;
>  
>  		if (!list_empty(&user->validators) &&
> -- 
> 2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ