clockevents: Prevent clockevent_devices list corruption on cpu hotplug
commit5c87f0c04abf876c8019c04ff581976a9a241206
authorThomas Gleixner <tglx@linutronix.de>
Thu, 10 Dec 2009 14:35:10 +0000 (10 15:35 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 6 Jan 2010 22:26:22 +0000 (6 14:26 -0800)
tree0db1a372467c01f642484f66fd8b34a982997eea
parentc7d622e356d6a21b788bd34cef607e01ae28c197
clockevents: Prevent clockevent_devices list corruption on cpu hotplug

commit bb6eddf7676e1c1f3e637aa93c5224488d99036f upstream.

Xiaotian Feng triggered a list corruption in the clock events list on
CPU hotplug and debugged the root cause.

If a CPU registers more than one per cpu clock event device, then only
the active clock event device is removed on CPU_DEAD. The unused
devices are kept in the clock events device list.

On CPU up the clock event devices are registered again, which means
that we list_add an already enqueued list_head. That results in list
corruption.

Resolve this by removing all devices which are associated to the dead
CPU on CPU_DEAD.

Reported-by: Xiaotian Feng <dfeng@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Xiaotian Feng <dfeng@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/time/clockevents.c