linux-stable/drivers/firewire
Niels Dossche 71fb770635 firewire: core: extend card->lock in fw_core_handle_bus_reset
commit a7ecbe92b9 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:14:57 +02:00
..
Kconfig
Makefile
core-card.c firewire: core: extend card->lock in fw_core_handle_bus_reset 2022-05-12 12:14:57 +02:00
core-cdev.c firewire: fix potential uaf in outbound_phy_packet_callback() 2022-05-12 12:14:56 +02:00
core-device.c
core-iso.c
core-topology.c firewire: core: extend card->lock in fw_core_handle_bus_reset 2022-05-12 12:14:57 +02:00
core-transaction.c firewire: remove check of list iterator against head past the loop body 2022-05-12 12:14:57 +02:00
core.h
init_ohci1394_dma.c
net.c net: add annotations on hh->hh_len lockless accesses 2020-01-12 11:24:19 +01:00
nosy-user.h
nosy.c firewire: nosy: Fix a use-after-free bug in nosy_ioctl() 2021-04-07 12:05:40 +02:00
nosy.h
ohci.c firewire-ohci: work around oversized DMA reads on JMicron controllers 2018-05-30 07:50:18 +02:00
ohci.h
sbp2.c firewire: remove check of list iterator against head past the loop body 2022-05-12 12:14:57 +02:00