linux/sound/hda
Takashi Iwai eb8d0eaaf8 ALSA: hda: Fix potential race at unregistration and unsol events
When the codec device is unregistered / freed, it may release the
resource while being used in an unsolicited event like the jack
detection work.  This leads to use-after-free.

The fix here is to unregister the device at first, i.e. removing the
codec from the list, then flushing the pending works to assure that
all unsol events are gone.  After this point, we're free from
accessing the codec via unsol events, thus can release the resources
gracefully.

The issue was spotted originally by Intel CI, but it couldn't be
reproduced reliably by its nature.  So let's hope this fix really
addresses the whole issues.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196045
Reported-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-20 07:53:57 +02:00
..
ext ALSA: hda - add more ML register definitions 2017-04-07 10:39:18 +02:00
array.c ALSA: hda: Fix krealloc() with __GFP_ZERO usage 2016-08-03 15:17:22 +02:00
hda_bus_type.c ALSA: hda - Advertise MODALIAS in uevent 2015-10-20 10:15:53 +02:00
hdac_bus.c ALSA: hda: Fix potential race at unregistration and unsol events 2017-06-20 07:53:57 +02:00
hdac_controller.c ALSA: hda: Fix cpu lockup when stopping the cmd dmas 2017-05-10 08:47:17 +02:00
hdac_device.c ALSA: hda: Fix potential race at unregistration and unsol events 2017-06-20 07:53:57 +02:00
hdac_i915.c drm/i915/dp: DP audio API changes for MST 2016-09-22 09:01:55 -07:00
hdac_regmap.c ALSA: hdac_regmap - fix the register access for runtime PM 2016-06-17 14:01:06 +02:00
hdac_stream.c ALSA: hda - Avoid tricky macros 2017-04-03 08:42:43 +02:00
hdac_sysfs.c ALSA: hda - Add hdaudio bus modalias support 2015-10-20 10:15:09 +02:00
hdmi_chmap.c ALSA: hda: fix some klockwork scan warnings 2016-06-16 10:10:12 +02:00
Kconfig ALSA: HDAC: move SND_HDA_PREALLOC_SIZE to core 2015-06-16 17:40:38 +02:00
local.h ALSA: hda - add helper to get channels from cap bits 2016-04-28 18:45:26 +01:00
Makefile ALSA: hda - Add hdmi chmap verb programming ops to chmap object 2016-03-07 15:41:31 +01:00
trace.c ALSA: hda - Re-add tracepoints to HD-audio core driver 2015-03-23 13:17:58 +01:00
trace.h ALSA: hda - add hdac stream trace 2015-05-18 10:06:20 +02:00