summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2026-10-08 00:34:46 +0200
committerTakashi Iwai <tiwai@suse.de>2026-10-08 08:58:08 +0200
commit7e1ad3c55baa80399f1727dfd2303fa4d1558d9a (patch)
treebda132dca8e19433f4392215f2455dec8ff04a1a /tools/lib/python
parentaf027278d8d9915b7cb32736404719f1aebd66a3 (diff)
ALSA: hda: Don't free card at probe error in vga_switcheroo handler
The vga_switcheroo handler azx_vs_set_state() calls azx_probe_contine() for enabling the audio, and if an error happens during the probe, azx_probe_continue() releases its associated sound card object at the error path. The card release procedure includes the call of vga_switcheroo_unregister_client(), and this triggers the vgasr_mutex lock again that had been already held by the caller (vga_switcheroo_process_delayed_switch()) -- leading to a deadlock. (Moreover, the card release will cause a potential UAF at the error message in azx_vs_set_state() since the card object is already gone; this was the original report by Sashiko.) For avoiding the unneeded crash, it's better to avoid the card release in this error path, so we make azx_probe_continue() behaving conditionally. In return, set hda->init_failed flag, so that any further (re-)attempts will be filtered after that point. The check of hda->init_failed is dropped from azx_vs_can_switch(). It's because otherwise vga_switcheroo can't be switched to turn off GPU once when a probe error happens at the audio side. Fixes: 39173303c838 ("ALSA: hda: Free card instance properly at probe errors") Reported-by: Sashiko <sashiko-bot@kernel.org> Link: https://sashiko.dev/#/patchset/20261007213728.155092-1-tiwai%40suse.de Link: https://patch.msgid.link/20261007223448.172443-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions