From: Cássio Gabriel <cassiogabrielcontato@gmail.com> mainline inclusion from mainline-v7.2-rc1 commit 5367e2ad14f0ae9350a7aaf2e77c87de39a43ae9 category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/18716 CVE: CVE-2026-80872 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- TAS2781 HDA I2C and SPI queue RCA firmware loading from component bind with request_firmware_nowait(). The firmware loader keeps the callback module pinned and holds a device reference, but the callback still uses driver-private HDA state. Component unbind removes controls and DSP state immediately. Later device removal tears down the TAS2781 private data, including codec_lock. If the async firmware callback runs after unbind has started, it can operate on state that is being torn down. Cancel or synchronize the async firmware request before removing controls and DSP state. A queued callback is cancelled, and an already-running callback is allowed to finish before unbind continues. Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Fixes: bb5f86ea50ff ("ALSA: hda/tas2781: Add tas2781 hda SPI driver") Cc: stable@vger.kernel.org Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Acked-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260505-alsa-hda-tas2781-fw-callback-teardown-v4-2... Conflicts: sound/pci/hda/tas2781_hda_i2c.c [The conflict arises from the directory of the tas2781_hda_i2c.c file being changed; the code within the file remains unchanged. The other file, tas2781_hda_spi.c (introduced in version v6.14), has not been merged into this version and is therefore not involved.] Signed-off-by: Tengda Wu <wutengda2@huawei.com> --- sound/pci/hda/tas2781_hda_i2c.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index 980e6104c2f3..e6ebb918e4a2 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -658,6 +658,9 @@ static void tas2781_hda_unbind(struct device *dev, comps->playback_hook = NULL; } + request_firmware_nowait_cancel(tas_hda->priv->dev, tas_hda->priv, + tasdev_fw_ready); + tas2781_hda_remove_controls(tas_hda); tasdevice_config_info_remove(tas_hda->priv); -- 2.34.1