ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF
Takes rwsem lock inside snd_ctl_elem_read instead of snd_ctl_elem_read_user like it was done for write in commit 1fa4445f ("ALSA: control - introduce snd_ctl_notify_one() helper"). Doing this way we are also fixing the following locking issue happening in the compat path which can be easily triggered and turned into an use-after-free. 64-bits: snd_ctl_ioctl snd_ctl_elem_read_user [takes controls_rwsem] snd_ctl_elem_read [lock properly held, all good] [drops controls_rwsem] 32-bits: snd_ctl_ioctl_compat snd_ctl_elem_write_read_compat ctl_elem_write_read snd_ctl_elem_read [missing lock, not good] CVE-2023-0266 was assigned for this issue. Cc: stable@kernel.org # 5.13+ Signed-off-by:Clement Lecigne <clecigne@google.com> Reviewed-by:
Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230113120745.25464-1-tiwai@suse.de Signed-off-by:
Takashi Iwai <tiwai@suse.de>
Loading
-
mentioned in commit c75e7766
-
mentioned in commit ac244baf
-
mentioned in commit 8f3ad721
-
mentioned in commit f9d1d9a9
-
mentioned in commit f0e42720
-
mentioned in commit 57d23e3c
-
mentioned in commit 0b3f3e3b
-
mentioned in commit 5a6bfbf9
-
mentioned in commit c1243be6
-
mentioned in commit df927889
-
mentioned in commit 2bc236b0
-
mentioned in commit c9c9f17d
-
mentioned in commit 435c7a54
-
mentioned in commit c84efb19
-
mentioned in commit 48ece9c3
-
mentioned in commit 1916e8c2
-
mentioned in commit 20afa44c
-
mentioned in commit f8258f37
-
mentioned in commit 9bef081c
-
mentioned in commit 827c689f
-
mentioned in commit cc6c5c7f
Please sign in to comment