]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commit
netback: take net_schedule_list_lock when removing entry from net_schedule_list
authorKeir Fraser <keir@xen.org>
Wed, 3 Nov 2010 08:20:42 +0000 (08:20 +0000)
committerKeir Fraser <keir@xen.org>
Wed, 3 Nov 2010 08:20:42 +0000 (08:20 +0000)
commit12a5cbb6a5fa1dc2172809a7a8204cc5f27b847e
tree5ecd688739d92bc50bde6a97d08b274bcd0f27e2
parent60e74086dbdd64a7221521b66e0dd2af2ea33b78
netback: take net_schedule_list_lock when removing entry from net_schedule_list

There is a race in net_tx_build_mops between checking if
net_schedule_list is empty and actually dequeuing the first entry on
the list. If another thread dequeues the only entry on the list during
this window we crash because list_first_entry expects a non-empty
list. Therefore after the initial lock free check for an empty list
check again with the lock held before dequeueing the entry.

Based on a patch by Tomasz Wroblewski.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
drivers/xen/netback/netback.c