WSL2-Linux-Kernel/drivers/cpuidle
Konrad Rzeszutek Wilk 813e8e3d6a cpuidle: Check for dev before deregistering it.
If not, we could end up in the unfortunate situation where
we dereference a NULL pointer b/c we have cpuidle disabled.

This is the case when booting under Xen (which uses the
ACPI P/C states but disables the CPU idle driver) - and can
be easily reproduced when booting with cpuidle.off=1.

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: [<ffffffff8156db4a>] cpuidle_unregister_device+0x2a/0x90
.. snip..
Call Trace:
 [<ffffffff813b15b4>] acpi_processor_power_exit+0x3c/0x5c
 [<ffffffff813af0a9>] acpi_processor_stop+0x61/0xb6
 [<ffffffff814215bf>] __device_release_driver+0fffff81421653>] device_release_driver+0x23/0x30
 [<ffffffff81420ed8>] bus_remove_device+0x108/0x180
 [<ffffffff8141d9d9>] device_del+0x129/0x1c0
 [<ffffffff813cb4b0>] ? unregister_xenbus_watch+0x1f0/0x1f0
 [<ffffffff8141da8e>] device_unregister+0x1e/0x60
 [<ffffffff814243e9>] unregister_cpu+0x39/0x60
 [<ffffffff81019e03>] arch_unregister_cpu+0x23/0x30
 [<ffffffff813c3c51>] handle_vcpu_hotplug_event+0xc1/0xe0
 [<ffffffff813cb4f5>] xenwatch_thread+0x45/0x120
 [<ffffffff810af010>] ? abort_exclusive_wait+0xb0/0xb0
 [<ffffffff8108ec42>] kthread+0xd2/0xf0
 [<ffffffff8108eb70>] ? kthread_create_on_node+0x180/0x180
 [<ffffffff816ce17c>] ret_from_fork+0x7c/0xb0
 [<ffffffff8108eb70>] ? kthread_create_on_node+0x180/0x180

This problem also appears in 3.12 and could be a candidate for backport.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-12-03 22:05:22 +01:00
..
governors cpuidle: Change struct menu_device field types 2013-08-23 00:24:16 +02:00
Kconfig cpuidle: big.LITTLE: vexpress-TC2 CPU idle driver 2013-08-28 11:28:51 -07:00
Kconfig.arm ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
Makefile ARM: at91: cpuidle: Move driver to drivers/cpuidle 2013-10-16 23:49:35 +02:00
coupled.c cpuidle: Fix comments in cpuidle core 2013-10-30 01:21:21 +01:00
cpuidle-at91.c ARM: at91: cpuidle: Move driver to drivers/cpuidle 2013-10-16 23:49:35 +02:00
cpuidle-big_little.c cpuidle: big.LITTLE: vexpress-TC2 CPU idle driver 2013-08-28 11:28:51 -07:00
cpuidle-calxeda.c cpuidle: calxeda: add support to use PSCI calls 2013-10-01 16:30:56 -05:00
cpuidle-kirkwood.c cpuidle-kirkwood.c: simplify use of devm_ioremap_resource() 2013-08-14 22:20:06 +02:00
cpuidle-ux500.c ARM: ux500: cpuidle: fix section mismatch 2013-10-07 16:47:07 +02:00
cpuidle-zynq.c ARM: zynq: cpuidle: convert to platform driver 2013-10-07 16:46:59 +02:00
cpuidle.c cpuidle: Check for dev before deregistering it. 2013-12-03 22:05:22 +01:00
cpuidle.h cpuidle: support multiple drivers 2012-11-15 00:34:23 +01:00
driver.c cpuidle: don't call poll_idle_init() for every cpu 2013-10-30 01:21:23 +01:00
governor.c cpuidle: remove cpuidle_unregister_governor() 2013-10-30 01:21:24 +01:00
sysfs.c cpuidle: use drv instead of cpuidle_driver in show_current_driver() 2013-10-30 01:21:23 +01:00