]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: pcm: prevent UAF in snd_pcm_info
authorRobb Glasser <rglasser@google.com>
Tue, 5 Dec 2017 17:16:55 +0000 (09:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 16 Dec 2017 09:32:27 +0000 (10:32 +0100)
commit14416b2c878b989674761118db8072bf7f0c9501
treea8becd7337cbb5b4ba6961560bec280d1fe6b2ca
parent346178f1aa5e082f5cfbe94affcbfa1e9d6086df
ALSA: pcm: prevent UAF in snd_pcm_info

commit 362bca57f5d78220f8b5907b875961af9436e229 upstream.

When the device descriptor is closed, the `substream->runtime` pointer
is freed. But another thread may be in the ioctl handler, case
SNDRV_CTL_IOCTL_PCM_INFO. This case calls snd_pcm_info_user() which
calls snd_pcm_info() which accesses the now freed `substream->runtime`.

Note: this fixes CVE-2017-0861

Signed-off-by: Robb Glasser <rglasser@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/pcm.c