Kernel Tree For Xiaomi 11 Lite NE 5G
Go to file
Tuo Li 109f0aaa0b ALSA: hda: fix a possible null-pointer dereference due to data race in snd_hdac_regmap_sync()
[ Upstream commit 1f4a08fed450db87fbb5ff5105354158bdbe1a22 ]

The variable codec->regmap is often protected by the lock
codec->regmap_lock when is accessed. However, it is accessed without
holding the lock when is accessed in snd_hdac_regmap_sync():

  if (codec->regmap)

In my opinion, this may be a harmful race, because if codec->regmap is
set to NULL right after the condition is checked, a null-pointer
dereference can occur in the called function regcache_sync():

  map->lock(map->lock_arg); --> Line 360 in drivers/base/regmap/regcache.c

To fix this possible null-pointer dereference caused by data race, the
mutex_lock coverage is extended to protect the if statement as well as the
function call to regcache_sync().

[ Note: the lack of the regmap_lock itself is harmless for the current
  codec driver implementations, as snd_hdac_regmap_sync() is only for
  PM runtime resume that is prohibited during the codec probe.
  But the change makes the whole code more consistent, so it's merged
  as is -- tiwai ]

Reported-by: BassCheck <bass@buaa.edu.cn>
Signed-off-by: Tuo Li <islituo@gmail.com>
Link: https://lore.kernel.org/r/20230703031016.1184711-1-islituo@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-30 16:27:11 +02:00
arch MIPS: dec: prom: Address -Warray-bounds warning 2023-08-30 16:27:09 +02:00
block block/partition: fix signedness issue for Amiga partitions 2023-07-27 08:37:29 +02:00
certs
crypto KEYS: asymmetric: Copy sig and digest in public_key_verify_signature() 2023-06-21 15:44:08 +02:00
Documentation Documentation: security-bugs.rst: clarify CVE handling 2023-08-11 11:53:52 +02:00
drivers drm/amdgpu: Fix potential fence use-after-free v2 2023-08-30 16:27:11 +02:00
fs gfs2: Fix possible data races in gfs2_show_options() 2023-08-30 16:27:10 +02:00
include media: v4l2-mem2mem: add lock to protect parameter num_rdy 2023-08-30 16:27:10 +02:00
init x86/mm: Initialize text poking earlier 2023-08-08 19:56:36 +02:00
ipc
kernel perf: Fix function pointer case 2023-08-11 11:53:54 +02:00
lib test_firmware: return ENOMEM instead of ENOSPC on failed memory allocation 2023-08-11 11:54:00 +02:00
LICENSES
mm mm: make wait_on_page_writeback() wait for multiple pending writebacks 2023-06-28 10:18:42 +02:00
net Bluetooth: L2CAP: Fix use-after-free 2023-08-30 16:27:11 +02:00
samples samples/bpf: Fix buffer overflow in tcp_basertt 2023-07-27 08:37:07 +02:00
scripts modpost: fix off by one in is_executable_section() 2023-07-27 08:37:18 +02:00
security keys: Fix linking a duplicate key to a keyring's assoc_array 2023-08-11 11:53:47 +02:00
sound ALSA: hda: fix a possible null-pointer dereference due to data race in snd_hdac_regmap_sync() 2023-08-30 16:27:11 +02:00
tools selftests: forwarding: tc_flower: Relax success criterion 2023-08-30 16:27:08 +02:00
usr
virt KVM: Destroy target device if coalesced MMIO unregistration fails 2023-03-11 16:44:01 +01:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS Remove DECnet support from kernel 2023-06-21 15:44:10 +02:00
Makefile Linux 5.4.254 2023-08-16 18:19:25 +02:00
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.