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]
Date:   Tue, 10 Mar 2020 15:09:31 +0100
From:   Alexandre Chartre <alexandre.chartre@...cle.com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>
Cc:     x86@...nel.org, Steven Rostedt <rostedt@...dmis.org>,
        Brian Gerst <brgerst@...il.com>,
        Juergen Gross <jgross@...e.com>,
        Frederic Weisbecker <frederic@...nel.org>
Subject: Re: [patch part-II V2 13/13] x86/entry/common: Split irq tracing in
 prepare_exit_to_usermode()


On 3/8/20 11:24 PM, Thomas Gleixner wrote:
> As in entry from user mode, lockdep and tracing have different
> requirements. lockdep needs to know about the interrupts off state accross
> the call to user_enter_irqsoff() but tracing is unsafe after the call.

typo: user_enter_irqoff() (no 's' between 'irq' and 'off').

> 
> Split it up and tell the tracer that interrupts are going to be enabled
> before calling user_enter_irqsoff() and tell lockdep afterwards.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
>   arch/x86/entry/common.c |   12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
> 
> --- a/arch/x86/entry/common.c
> +++ b/arch/x86/entry/common.c
> @@ -251,9 +251,19 @@ static noinline void __prepare_exit_to_u
>   {
>   	__prepare_exit_to_usermode(regs);
>   
> +	/*
> +	 * Return to user space enables interrupts. Tell the tracer before
> +	 * invoking user_enter_irqsoff() which switches to CONTEXT_USER and

Same typo here: user_enter_irqoff()

> +	 * RCU to rcuidle state. Lockdep still needs to keep the irqs
> +	 * disabled state.
> +	 */
> +	__trace_hardirqs_on();
> +
>   	user_enter_irqoff();
>   	mds_user_clear_cpu_buffers();
> -	trace_hardirqs_on();
> +
> +	/* All done. Tell lockdep as well. */
> +	lockdep_hardirqs_on(CALLER_ADDR0);
>   }
>   NOKPROBE_SYMBOL(prepare_exit_to_usermode);
>   
> 

Reviewed-by: Alexandre Chartre <alexandre.chartre@...cle.com>

alex.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ