alistair23-linux/drivers/hv
Vitaly Kuznetsov 04a258c162 Drivers: hv: vmbus: Fix a race condition when unregistering a device
When build with Debug the following crash is sometimes observed:
Call Trace:
 [<ffffffff812b9600>] string+0x40/0x100
 [<ffffffff812bb038>] vsnprintf+0x218/0x5e0
 [<ffffffff810baf7d>] ? trace_hardirqs_off+0xd/0x10
 [<ffffffff812bb4c1>] vscnprintf+0x11/0x30
 [<ffffffff8107a2f0>] vprintk+0xd0/0x5c0
 [<ffffffffa0051ea0>] ? vmbus_process_rescind_offer+0x0/0x110 [hv_vmbus]
 [<ffffffff8155c71c>] printk+0x41/0x45
 [<ffffffffa004ebac>] vmbus_device_unregister+0x2c/0x40 [hv_vmbus]
 [<ffffffffa0051ecb>] vmbus_process_rescind_offer+0x2b/0x110 [hv_vmbus]
...

This happens due to the following race: between 'if (channel->device_obj)' check
in vmbus_process_rescind_offer() and pr_debug() in vmbus_device_unregister() the
device can disappear. Fix the issue by taking an additional reference to the
device before proceeding to vmbus_device_unregister().

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 10:21:44 -08:00
..
channel.c Drivers: hv: vmbus: Properly protect calls to smp_processor_id() 2014-09-23 23:31:21 -07:00
channel_mgmt.c Drivers: hv: vmbus: Fix a race condition when unregistering a device 2014-11-07 10:21:44 -08:00
connection.c Drivers: hv: vmbus: Cleanup vmbus_post_msg() 2014-09-23 23:30:38 -07:00
hv.c Drivers: hv: vmbus: Cleanup hv_post_message() 2014-09-23 23:31:21 -07:00
hv_balloon.c Drivers: hv: balloon: Ensure pressure reports are posted regularly 2014-05-03 19:25:17 -04:00
hv_fcopy.c Drivers: hv: hv_fcopy: fix a race condition for SMP guest 2014-07-17 18:43:10 -07:00
hv_kvp.c Drivers: hv: util: Fix a bug in the KVP code 2014-07-09 14:34:35 -07:00
hv_snapshot.c connector: add portid to unicast in addition to broadcasting 2014-02-07 15:40:17 -08:00
hv_util.c Drivers: hv: util: Fix a bug in the KVP code 2014-07-09 14:34:35 -07:00
hyperv_vmbus.h Drivers: hv: vmbus: Cleanup hv_post_message() 2014-09-23 23:31:21 -07:00
Kconfig x86: Make Linux guest support optional 2013-03-04 13:14:25 -08:00
Makefile Drivers: hv: Implement the file copy service 2014-02-18 10:53:48 -08:00
ring_buffer.c Drivers: hv: vmbus: Enable interrupt driven flow control 2014-09-23 23:31:22 -07:00
vmbus_drv.c hyper-v: make uuid_le const 2014-06-03 18:18:38 -07:00