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: <20151104064836.661b0e01@tlielax.poochiereds.net>
Date:	Wed, 4 Nov 2015 06:48:36 -0500
From:	Jeff Layton <jlayton@...chiereds.net>
To:	Tejun Heo <tj@...nel.org>
Cc:	Chris Worley <chris.worley@...marydata.com>,
	linux-kernel@...r.kernel.org, bfields@...ldses.org,
	Michael Skralivetsky <michael.skralivetsky@...marydata.com>,
	Trond Myklebust <trond.myklebust@...marydata.com>,
	Shaohua Li <shli@...com>
Subject: Re: timer code oops when calling mod_delayed_work

On Tue, 3 Nov 2015 19:06:58 -0500
Tejun Heo <tj@...nel.org> wrote:

> Hello, Jeff.
> 
> Can you please verify whether the following patch fixes the issue?
> 
> Thanks.
> 
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index 84190f0..566a282 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -970,12 +970,21 @@ EXPORT_SYMBOL(add_timer);
>   */
>  void add_timer_on(struct timer_list *timer, int cpu)
>  {
> -	struct tvec_base *base = per_cpu_ptr(&tvec_bases, cpu);
> +	struct tvec_base *new_base = per_cpu_ptr(&tvec_bases, cpu);
> +	struct tvec_base *base;
>  	unsigned long flags;
>  
>  	timer_stats_timer_set_start_info(timer);
>  	BUG_ON(timer_pending(timer) || !timer->function);
> -	spin_lock_irqsave(&base->lock, flags);
> +
> +	base = lock_timer_base(timer, &flags);
> +	if (base != new_base) {
> +		timer->flags |= TIMER_MIGRATING;
> +		spin_unlock(&base->lock);
> +		base = new_base;
> +		spin_lock(&base->lock);
> +	}
> +
>  	timer->flags = (timer->flags & ~TIMER_BASEMASK) | cpu;
>  	debug_activate(timer, timer->expires);
>  	internal_add_timer(base, timer);

Yes, thanks! That fixes my reproducer and Chris also said he was unable
to reproduce the bug after applying that patch. You can add this if you
like:

   Tested-by: Jeff Layton <jlayton@...chiereds.net>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ