linux/sound/aoa
Takashi Iwai bc41a7228c ALSA: pcm: Don't embed device
So far we use the embedded struct device for each PCM substreams in
struct snd_pcm.  This may result in UAF when the delayed kobj release
is used; each corresponding struct device is still accessed at the
(delayed) device release, while the snd_pcm object may be already
gone.

As a workaround, detach the struct device from the snd_pcm object by
allocating via the new snd_device_alloc() helper.

A caveat is that we store the PCM substream pointer to drvdata since
the device resume and others require the access to it.

This patch is based on the fix Curtis posted initially.  In this
patch, the changes are split and use the new helper function instead.

Link: https://lore.kernel.org/r/20230801171928.1460120-1-cujomalainey@chromium.org
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230816160252.23396-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:23:45 +02:00
..
codecs ALSA: Switch i2c drivers back to use .probe() 2023-06-05 09:22:45 +02:00
core ALSA: Convert strlcpy to strscpy when return value is unused 2021-01-08 09:30:05 +01:00
fabrics ALSA: aoa: make remove callback of soundbus driver void returned 2023-01-25 09:34:29 +01:00
soundbus ALSA: pcm: Don't embed device 2023-08-17 09:23:45 +02:00
aoa-gpio.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 250 2019-06-19 17:09:08 +02:00
aoa.h ALSA: aoa: Constify snd_device_ops definitions 2020-01-03 09:24:01 +01:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00