aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
diff options
context:
space:
mode:
authorTakashi Iwai <[email protected]>2018-04-02 20:41:43 +0000
committerTakashi Iwai <[email protected]>2018-04-03 06:36:40 +0000
commita820ccbe21e8ce8e86c39cd1d3bc8c7d1cbb949b (patch)
treee5b3fd50df32c9c9fa8b18f96079f5eb0a476888 /drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
parentMerge tag 'asoc-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broon... (diff)
downloadkernel-a820ccbe21e8ce8e86c39cd1d3bc8c7d1cbb949b.tar.gz
kernel-a820ccbe21e8ce8e86c39cd1d3bc8c7d1cbb949b.zip
ALSA: pcm: Fix UAF at PCM release via PCM timer access
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: [email protected] Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c')
0 files changed, 0 insertions, 0 deletions