ACPI / PM: Walk physical_node_list under physical_node_lock
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 6 Aug 2013 00:26:22 +0000 (02:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Aug 2013 05:59:07 +0000 (22:59 -0700)
commitb97f921b94b1e70d5de999fd820ccf8504dc6528
tree66c405bdc3086d5519c2d16ce07a65016d2967f2
parentda712f3a8c493986b19fd0863b45607c34061ba6
ACPI / PM: Walk physical_node_list under physical_node_lock

commit 623cf33cb055b1e81fa47e4fc16789b2c129e31e upstream.

The list of physical devices corresponding to an ACPI device
object is walked by acpi_system_wakeup_device_seq_show() and
physical_device_enable_wakeup() without taking that object's
physical_node_lock mutex.  Since each of those functions may be
run at any time as a result of a user space action, the lack of
appropriate locking in them may lead to a kernel crash if that
happens during device hot-add or hot-remove involving the device
object in question.

Fix the issue by modifying acpi_system_wakeup_device_seq_show() and
physical_device_enable_wakeup() to use physical_node_lock as
appropriate.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/proc.c