No description
Find a file
Clement Lecigne df02234e6b ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF
[ Note: this is a fix that works around the bug equivalently as the
  two upstream commits:
   1fa4445f9a ("ALSA: control - introduce snd_ctl_notify_one() helper")
   56b88b5056 ("ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF")
  but in a simpler way to fit with older stable trees -- tiwai ]

Add missing locking in ctl_elem_read_user/ctl_elem_write_user which can be
easily triggered and turned into an use-after-free.

Example code paths with SNDRV_CTL_IOCTL_ELEM_READ:

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 (compat):
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.

Signed-off-by: Clement Lecigne <clecigne@google.com>
Cc: stable@kernel.org # 5.12 and older
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-14 10:16:52 +01:00
arch parisc: Align parisc MADV_XXX constants with all other architectures 2023-01-14 10:16:51 +01:00
block
certs
crypto
Documentation
drivers serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way" 2023-01-14 10:16:51 +01:00
fs ext4: don't set up encryption key during jbd2 transaction 2023-01-14 10:16:51 +01:00
include mptcp: remove MPTCP 'ifdef' in TCP SYN cookies 2023-01-14 10:16:51 +01:00
init
io_uring io_uring: Fix unsigned 'res' comparison with zero in io_fixup_rw_res() 2023-01-14 10:16:50 +01:00
ipc
kernel
lib
LICENSES
mm
net net/ulp: prevent ULP without clone op from entering the LISTEN status 2023-01-14 10:16:52 +01:00
samples
scripts
security
sound ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF 2023-01-14 10:16:52 +01:00
tools parisc: Align parisc MADV_XXX constants with all other architectures 2023-01-14 10:16:51 +01:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.