linux-yocto/sound/aoa/soundbus
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
..
i2sbus ALSA: pcm: Don't embed device 2023-08-17 09:23:45 +02:00
core.c driver core: make struct bus_type.uevent() take a const * 2023-01-27 13:45:52 +01:00
Kconfig
Makefile
soundbus.h ALSA: aoa: make remove callback of soundbus driver void returned 2023-01-25 09:34:29 +01:00
sysfs.c ALSA: aoa: Replace sprintf() with sysfs_emit() 2022-08-02 16:03:42 +02:00