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: <20080922144303.GA295@tv-sign.ru>
Date:	Mon, 22 Sep 2008 18:43:03 +0400
From:	Oleg Nesterov <oleg@...sign.ru>
To:	Krishna Kumar <krkumar2@...ibm.com>
Cc:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [RFC] [PATCH 1/1]: timers: Change add_timer to use add_timer_on

(add Thomas)

On 09/22, Krishna Kumar wrote:
>
> timer: Change add_timer to not check for existing timer.

Perhaps the changelog should explain why ;)

But, besides the removing BUG_ON(), the patch does something else.

>  static inline void add_timer(struct timer_list *timer)
>  {
> -	BUG_ON(timer_pending(timer));
> -	__mod_timer(timer, timer->expires);
> +	add_timer_on(timer, raw_smp_processor_id());
>  }

This is racy wrt CPU hotplug. The CPU can be cpu_down()'ed right
after raw_smp_processor_id() returns, and before we actually add
the timer.

Another problem is that now it is add_timer() becomes unsafe wrt
concurrent del_timer/del_timer_sync, because add_timer_on() does
not lock the timer, it only locks the target base.

Oleg.

--
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