linux/sound
Aleksei Vetrov 2ef9439f7a
ASoC: dapm: fix bounds checker error in dapm_widget_list_create
The widgets array in the snd_soc_dapm_widget_list has a __counted_by
attribute attached to it, which points to the num_widgets variable. This
attribute is used in bounds checking, and if it is not set before the
array is filled, then the bounds sanitizer will issue a warning or a
kernel panic if CONFIG_UBSAN_TRAP is set.

This patch sets the size of the widgets list calculated with
list_for_each as the initial value for num_widgets as it is used for
allocating memory for the array. It is updated with the actual number of
added elements after the array is filled.

Signed-off-by: Aleksei Vetrov <vvvvvv@google.com>
Fixes: 80e698e2df ("ASoC: soc-dapm: Annotate struct snd_soc_dapm_widget_list with __counted_by")
Link: https://patch.msgid.link/20241028-soc-dapm-bounds-checker-fix-v1-1-262b0394e89e@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-10-28 23:30:33 +00:00
..
ac97 driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
aoa ALSA: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-09-20 17:44:52 +02:00
arm ASoC: Updates for v6.10 2024-05-13 11:39:49 +02:00
atmel ALSA: misc: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:13 +02:00
core ALSA: core: add isascii() check to card ID generator 2024-10-03 09:16:58 +02:00
drivers ALSA: aloop: Allow using global timers 2024-08-18 09:55:54 +02:00
firewire ALSA: firewire: use nonatomic PCM operation 2024-09-04 21:51:54 +09:00
hda ASoC: Intel: sst: Support LPE0F28 ACPI HID 2024-10-25 14:10:11 +01:00
i2c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
isa ALSA: gus: Fix some error handling paths related to get_bpos() usage 2024-10-04 09:02:30 +02:00
mips ALSA: misc: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:13 +02:00
oss [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
parisc ALSA: misc: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:13 +02:00
pci sound fixes for 6.12-rc2 2024-10-04 11:29:46 -07:00
pcmcia ALSA: vxpocket: Fix a typo at conversion to dev_*() 2024-08-08 20:23:41 +02:00
ppc ALSA: ppc: Use standard print API 2024-08-08 07:49:47 +02:00
sh ALSA: sh: Use standard print API 2024-08-08 07:49:47 +02:00
soc ASoC: dapm: fix bounds checker error in dapm_widget_list_create 2024-10-28 23:30:33 +00:00
sparc ALSA: sparc: Fix a typo at dev_*() conversion 2024-08-09 09:39:48 +02:00
spi ALSA: spi: Drop NULL check for snd_ctl_remove() 2024-06-18 12:54:34 +02:00
synth ALSA: emux: Use standard print API 2024-08-08 07:49:46 +02:00
usb ALSA: line6: add hw monitor volume control to POD HD500X 2024-10-04 09:05:24 +02:00
virtio virtio: rename virtio_find_vqs_info() to virtio_find_vqs() 2024-07-17 05:20:58 -04:00
x86 Merge drm/drm-next into drm-intel-next 2024-06-19 11:38:31 +03:00
xen ALSA: xen-front: remove unused struct 'alsa_sndif_hw_param' 2024-06-13 14:14:46 +02:00
ac97_bus.c ALSA: ac97: legacy: Add missing module description 2024-05-09 10:13:07 +02:00
Kconfig
last.c
Makefile ALSA: core: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:32 +02:00
sound_core.c