kernel_optimize_test/drivers/firewire
Niels Dossche 68f35987d4 firewire: core: extend card->lock in fw_core_handle_bus_reset
commit a7ecbe92b9243edbe94772f6f2c854e4142a3345 upstream.

card->local_node and card->bm_retries are both always accessed under
card->lock.
fw_core_handle_bus_reset has a check whose condition depends on
card->local_node and whose body writes to card->bm_retries.
Both of these accesses are not under card->lock. Move the lock acquiring
of card->lock to before this check such that these accesses do happen
when card->lock is held.
fw_destroy_nodes is called inside the check.
Since fw_destroy_nodes already acquires card->lock inside its function
body, move this out to the callsites of fw_destroy_nodes.
Also add a comment to indicate which locking is necessary when calling
fw_destroy_nodes.

Cc: <stable@vger.kernel.org>
Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20220409041243.603210-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-12 12:25:32 +02:00
..
core-card.c firewire: core: extend card->lock in fw_core_handle_bus_reset 2022-05-12 12:25:32 +02:00
core-cdev.c firewire: fix potential uaf in outbound_phy_packet_callback() 2022-05-12 12:25:31 +02:00
core-device.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
core-iso.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
core-topology.c firewire: core: extend card->lock in fw_core_handle_bus_reset 2022-05-12 12:25:32 +02:00
core-transaction.c firewire: remove check of list iterator against head past the loop body 2022-05-12 12:25:32 +02:00
core.h firewire: ohci: Replace zero-length array with flexible-array 2020-06-15 23:08:31 -05:00
init_ohci1394_dma.c
Kconfig
Makefile
net.c
nosy-user.h
nosy.c firewire: nosy: Fix a use-after-free bug in nosy_ioctl() 2021-04-07 15:00:11 +02:00
nosy.h
ohci.c firewire-ohci: use dma_alloc_pages 2020-09-25 06:20:48 +02:00
ohci.h
sbp2.c firewire: remove check of list iterator against head past the loop body 2022-05-12 12:25:32 +02:00