linux-stable/sound
Kees Cook 0adacf6d6b ASoC: kirkwood: Iterate over array indexes instead of using pointer math
[ Upstream commit b3bcedc040 ]

Walking the dram->cs array was seen as accesses beyond the first array
item by the compiler. Instead, use the array index directly. This allows
for run-time bounds checking under CONFIG_UBSAN_BOUNDS as well. Seen
with GCC 13 with -fstrict-flex-arrays:

../sound/soc/kirkwood/kirkwood-dma.c: In function
'kirkwood_dma_conf_mbus_windows.constprop':
../sound/soc/kirkwood/kirkwood-dma.c:90:24: warning: array subscript 0 is outside array bounds of 'const struct mbus_dram_window[0]' [-Warray-bounds=]
   90 |                 if ((cs->base & 0xffff0000) < (dma & 0xffff0000)) {
      |                      ~~^~~~~~

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230127224128.never.410-kees@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-11 16:39:53 +01:00
..
ac97 ALSA: ac97: fix PM reference leak in ac97_bus_remove() 2021-07-20 16:05:40 +02:00
aoa ALSA: aoa: Fix I2S device accounting 2022-11-03 23:57:53 +09:00
arm amba: Make the remove callback return void 2022-04-08 14:40:02 +02:00
atmel
core ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF 2023-01-14 10:16:52 +01:00
drivers ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt 2023-01-14 10:15:38 +01:00
firewire ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes 2022-05-12 12:25:29 +02:00
hda ALSA: hda: add snd_hdac_stop_streams() helper 2023-01-14 10:16:20 +01:00
i2c
isa ALSA: wavefront: Proper check of get_user() error 2022-05-25 09:17:55 +02:00
mips
oss
parisc
pci ALSA: hda/ca0132: minor fix for allocation size 2023-03-11 16:39:32 +01:00
pcmcia
ppc ALSA: ppc: fix error return code in snd_pmac_probe() 2021-07-20 16:05:43 +02:00
sh
soc ASoC: kirkwood: Iterate over array indexes instead of using pointer math 2023-03-11 16:39:53 +01:00
sparc
spi ALSA: spi: Add check for clk_enable() 2022-04-08 14:40:08 +02:00
synth ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() 2023-02-15 17:22:22 +01:00
usb ALSA: line6: fix stack overflow in line6_midi_transmit 2023-01-14 10:16:27 +01:00
x86 ALSA: intel_hdmi: Fix reference to PCM buffer address 2022-03-08 19:09:31 +01:00
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c