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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210122171211.3d1de176@gandalf.local.home>
Date:   Fri, 22 Jan 2021 17:12:11 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 3/3] tracing: Remove NULL check from current in
 tracing_generic_entry_update().

On Wed, 13 Jan 2021 00:00:57 +0100
Sebastian Andrzej Siewior <bigeasy@...utronix.de> wrote:

> I can't imagine when or why `current' would return a NULL pointer. This
> check was added in commit
>       72829bc3d63cd ("ftrace: move enums to ftrace.h and make helper function global")
> 
> but it doesn't give me hint why it was needed.
> 
> Assume `current' never returns a NULL pointer and remove the check.

I'm guessing this is unrelated to the patch series, and I can take this now
separately.

-- Steve


> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> ---
>  include/linux/trace_events.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
> index aa9123878e126..252dfcabda3c1 100644
> --- a/include/linux/trace_events.h
> +++ b/include/linux/trace_events.h
> @@ -152,10 +152,8 @@ static inline void tracing_generic_entry_update(struct trace_entry *entry,
>  						unsigned short type,
>  						unsigned int trace_ctx)
>  {
> -	struct task_struct *tsk = current;
> -
>  	entry->preempt_count		= trace_ctx & 0xff;
> -	entry->pid			= (tsk) ? tsk->pid : 0;
> +	entry->pid			= current->pid;
>  	entry->type			= type;
>  	entry->flags =			trace_ctx >> 16;
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ