linux-kernel-test/drivers/firewire
Stefan Richter 90963f1cdb firewire: core: fix race at address_handler unregistration
Fix the following unlikely but possible race:

CPU 1                             CPU 2
------------------------------------------------------------------------
AR-request tasklet
    lookup handler
                                  unregister handler
				  free handler->callback_data or handler
    call handler->callback

The application which registered the handler has no way to stop nodes
sending new requests to their address range, hence cannot prevent this
race.

Fix it simply by extending the address_handler_lock-protected region
from only around the lookup to around both lookup and call.  We only
need to do so in the exclusive region handler; the FCP region handler
already holds the lock around the handler->callback call.

Alas this removes the current ability to execute the callback in
parallel on different CPUs if it was called for different FireWire cards
at the same time.  (For a single card, the handler is already
serialized.)  If this loss of a rather obscure feature is not tolerable,
a more complex fix would be required:  Add a handler reference counter;
wait in fw_core_remove_address_handler() for this conter to become zero.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2012-02-22 22:36:01 +01:00
..
core-card.c firewire: core: prefix log messages with card name 2012-02-22 22:36:00 +01:00
core-cdev.c firewire: core: prefix log messages with card name 2012-02-22 22:36:00 +01:00
core-device.c firewire: core: prefix log messages with card name 2012-02-22 22:36:00 +01:00
core-iso.c firewire: optimize iso queueing by setting wake only after the last packet 2011-05-10 22:53:45 +02:00
core-topology.c firewire: core: prefix log messages with card name 2012-02-22 22:36:00 +01:00
core-transaction.c firewire: core: fix race at address_handler unregistration 2012-02-22 22:36:01 +01:00
core.h firewire: core: prefix log messages with card name 2012-02-22 22:36:00 +01:00
init_ohci1394_dma.c ieee1394: move init_ohci1394_dma to drivers/firewire/ 2010-10-11 14:48:03 +02:00
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2011-03-21 10:05:22 -07:00
Makefile ieee1394: move init_ohci1394_dma to drivers/firewire/ 2010-10-11 14:48:03 +02:00
net.c firewire: net: use dev_printk API 2012-02-22 22:36:00 +01:00
nosy-user.h firewire: nosy: endianess fixes and annotations 2010-07-27 11:04:11 +02:00
nosy.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
nosy.h firewire: nosy: misc cleanups 2010-07-27 11:04:10 +02:00
ohci.c firewire: ohci: use dev_printk API 2012-01-15 18:37:21 +01:00
ohci.h firewire: ohci: fix TI TSB82AA2 regression since 2.6.35 2010-10-17 14:09:12 +02:00
sbp2.c firewire: sbp2: identify to driver core as "firewire_sbp2", not "sbp2" 2012-02-22 22:35:59 +01:00