summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-04-02 22:41:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-24 09:32:07 +0200
commitbb256eeaec50d26413822ab8ef1fa51789fa0a2c (patch)
treee6f3afaf3e23fce413c66d107a2fac15d048e573 /ipc
parentfe8fd32fb234272097104fe0a88fe126becfe5ff (diff)
ALSA: pcm: Fix UAF at PCM release via PCM timer access
commit a820ccbe21e8ce8e86c39cd1d3bc8c7d1cbb949b upstream. The PCM runtime object is created and freed dynamically at PCM stream open / close time. This is tracked via substream->runtime, and it's cleared at snd_pcm_detach_substream(). The runtime object assignment is protected by PCM open_mutex, so for all PCM operations, it's safely handled. However, each PCM substream provides also an ALSA timer interface, and user-space can access to this while closing a PCM substream. This may eventually lead to a UAF, as snd_pcm_timer_resolution() tries to access the runtime while clearing it in other side. Fortunately, it's the only concurrent access from the PCM timer, and it merely reads runtime->timer_resolution field. So, we can avoid the race by reordering kfree() and wrapping the substream->runtime clearance with the corresponding timer lock. Reported-by: syzbot+8e62ff4e07aa2ce87826@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions