linux-stable/sound/firewire
Takashi Sakamoto bf0cd60b7e ALSA: firewire-lib: fix uninitialized flag for AV/C deferred transaction
AV/C deferred transaction was supported at a commit 00a7bb81c2 ("ALSA:
firewire-lib: Add support for deferred transaction") while 'deferrable'
flag can be uninitialized for non-control/notify AV/C transactions.
UBSAN reports it:

kernel: ================================================================================
kernel: UBSAN: invalid-load in /build/linux-aa0B4d/linux-5.15.0/sound/firewire/fcp.c:363:9
kernel: load of value 158 is not a valid value for type '_Bool'
kernel: CPU: 3 PID: 182227 Comm: irq/35-firewire Tainted: P           OE     5.15.0-18-generic #18-Ubuntu
kernel: Hardware name: Gigabyte Technology Co., Ltd. AX370-Gaming 5/AX370-Gaming 5, BIOS F42b 08/01/2019
kernel: Call Trace:
kernel:  <IRQ>
kernel:  show_stack+0x52/0x58
kernel:  dump_stack_lvl+0x4a/0x5f
kernel:  dump_stack+0x10/0x12
kernel:  ubsan_epilogue+0x9/0x45
kernel:  __ubsan_handle_load_invalid_value.cold+0x44/0x49
kernel:  fcp_response.part.0.cold+0x1a/0x2b [snd_firewire_lib]
kernel:  fcp_response+0x28/0x30 [snd_firewire_lib]
kernel:  fw_core_handle_request+0x230/0x3d0 [firewire_core]
kernel:  handle_ar_packet+0x1d9/0x200 [firewire_ohci]
kernel:  ? handle_ar_packet+0x1d9/0x200 [firewire_ohci]
kernel:  ? transmit_complete_callback+0x9f/0x120 [firewire_core]
kernel:  ar_context_tasklet+0xa8/0x2e0 [firewire_ohci]
kernel:  tasklet_action_common.constprop.0+0xea/0xf0
kernel:  tasklet_action+0x22/0x30
kernel:  __do_softirq+0xd9/0x2e3
kernel:  ? irq_finalize_oneshot.part.0+0xf0/0xf0
kernel:  do_softirq+0x75/0xa0
kernel:  </IRQ>
kernel:  <TASK>
kernel:  __local_bh_enable_ip+0x50/0x60
kernel:  irq_forced_thread_fn+0x7e/0x90
kernel:  irq_thread+0xba/0x190
kernel:  ? irq_thread_fn+0x60/0x60
kernel:  kthread+0x11e/0x140
kernel:  ? irq_thread_check_affinity+0xf0/0xf0
kernel:  ? set_kthread_struct+0x50/0x50
kernel:  ret_from_fork+0x22/0x30
kernel:  </TASK>
kernel: ================================================================================

This commit fixes the bug. The bug has no disadvantage for the non-
control/notify AV/C transactions since the flag has an effect for AV/C
response with INTERIM (0x0f) status which is not used for the transactions
in AV/C general specification.

Fixes: 00a7bb81c2 ("ALSA: firewire-lib: Add support for deferred transaction")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20220304125647.78430-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2022-03-04 17:23:21 +01:00
..
bebob ALSA: bebob: correct duplicated entries with TerraTec OUI 2021-07-05 19:31:12 +02:00
dice ALSA: dice: cease from delayed card registration 2021-06-07 17:14:14 +02:00
digi00x ALSA: firewire-digi00x: cease from delayed card registration 2021-06-07 17:14:29 +02:00
fireface ALSA: fireface: cease from delayed card registration 2021-06-07 17:14:48 +02:00
fireworks ALSA: fireworks: add support for Loud Onyx 1200f quirk 2021-11-11 14:02:02 +01:00
motu ALSA: firewire-motu: add support for MOTU Track 16 2021-11-08 13:49:27 +01:00
oxfw ALSA: oxfw: fix functional regression for Mackie Onyx 1640i in v5.14 or later 2021-10-28 17:33:11 +02:00
tascam ALSA: firewire-tascam: cease from delayed card registration 2021-06-07 17:14:36 +02:00
Kconfig ALSA: firewire-motu: add support for MOTU Track 16 2021-11-08 13:49:27 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
amdtp-am824.c ALSA: firewire-lib/motu: use int type for the value of bitwise OR with enumerator-constant 2021-05-18 12:21:52 +02:00
amdtp-am824.h ALSA: firewire-lib/motu: use int type for the value of bitwise OR with enumerator-constant 2021-05-18 12:21:52 +02:00
amdtp-stream-trace.h ALSA: firewire-lib: replace in_interrupt() with in_softirq() 2021-06-12 09:31:41 +02:00
amdtp-stream.c ALSA: firewire-lib: Fix 'amdtp_domain_start()' when no AMDTP_OUT_STREAM stream is found 2021-06-25 09:38:11 +02:00
amdtp-stream.h ALSA: firewire-lib: obsolete workqueue for period update 2021-06-10 09:50:37 +02:00
cmp.c ALSA: firewire: fix kernel-doc 2020-07-07 12:09:32 +02:00
cmp.h ALSA: firewire-lib: split allocation of isochronous resources from establishment of connection 2019-06-17 08:18:36 +02:00
fcp.c ALSA: firewire-lib: fix uninitialized flag for AV/C deferred transaction 2022-03-04 17:23:21 +01:00
fcp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
isight.c ALSA: firewire: Drop superfluous ioctl PCM ops 2019-12-11 07:25:27 +01:00
iso-resources.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345 2019-06-05 17:37:08 +02:00
iso-resources.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lib.c ALSA: firewire-lib: delete unused kernel API 2021-06-07 17:14:54 +02:00
lib.h ALSA: firewire-lib: delete unused kernel API 2021-06-07 17:14:54 +02:00
packets-buffer.c ALSA: firewire: fix a memory leak bug 2019-08-08 11:12:26 +02:00
packets-buffer.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00