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, 16 Jan 2018 02:02:38 +0100
From:   Ingo Molnar <mingo@...nel.org>
To:     Anna-Maria Gleixner <anna-maria@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>, keescook@...omium.org,
        Christoph Hellwig <hch@....de>,
        John Stultz <john.stultz@...aro.org>
Subject: Re: [PATCH v4 02/36] hrtimer: Correct blantanly wrong comment


* Anna-Maria Gleixner <anna-maria@...utronix.de> wrote:

> From: Thomas Gleixner <tglx@...utronix.de>
> 
> The protection of a hrtimer which runs its callback against migration to a
> different CPU has nothing to do with hard interrupt context.
> 
> The protection against migration of a hrtimer running the expiry callback
> is the pointer in the cpu_base which holds a pointer to the currently
> running timer. This pointer is evaluated in the code which potentially
> switches the timer base and makes sure it's kept on the CPU on which the
> callback is running.
> 
> Reported-by: Anna-Maria Gleixner <anna-maria@...utronix.de>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Anna-Maria Gleixner <anna-maria@...utronix.de>
> ---
>  kernel/time/hrtimer.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
> index 69d203d8b12d..aee49c0c58b9 100644
> --- a/kernel/time/hrtimer.c
> +++ b/kernel/time/hrtimer.c
> @@ -1195,9 +1195,9 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
>  		timer->is_rel = false;
>  
>  	/*
> -	 * Because we run timers from hardirq context, there is no chance
> -	 * they get migrated to another cpu, therefore its safe to unlock
> -	 * the timer base.
> +	 * The timer is marked as running in the cpu base, so it is
> +	 * protected against migration to a different CPU even if the lock
> +	 * is dropped.

Small, nit:

   s/cpu/CPU

to keep the capitalization consistent within the same sentence.

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ