linux-sg2042/sound/pci/lola
Kees Cook 12626530de ALSA: lola: Bounds check loop iterator against streams array size
GCC 12 sees that it's technically possible for num_streams to be larger
than ARRAY_SIZE(pcm->streams). Bounds-check the iterator.

../sound/pci/lola/lola_pcm.c: In function 'lola_pcm_update':
../sound/pci/lola/lola_pcm.c:567:64: warning: array subscript [0, 31] is outside array bounds of 'struct lola_stream[16]' [-Warray-bounds]
  567 |                         struct lola_stream *str = &pcm->streams[i];
      |                                                    ~~~~~~~~~~~~^~~
In file included from ../sound/pci/lola/lola_pcm.c:15:
../sound/pci/lola/lola.h:307:28: note: while referencing 'streams'
  307 |         struct lola_stream streams[MAX_STREAM_COUNT];
      |                            ^~~~~~~

Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220520165537.2139826-1-keescook@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2022-05-21 08:48:57 +02:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
lola.c ALSA: lola: Fix the missing snd_card_free() call at probe error 2022-04-12 17:58:37 +02:00
lola.h ALSA: lola: Allocate resources with device-managed APIs 2021-07-19 16:17:02 +02:00
lola_clock.c ALSA: lola: Use DIV_ROUND_UP() instead of open-coding it 2020-12-25 09:11:52 +01:00
lola_mixer.c ALSA: lola: add a check for the return of vmalloc() 2022-03-04 09:51:37 +01:00
lola_pcm.c ALSA: lola: Bounds check loop iterator against streams array size 2022-05-21 08:48:57 +02:00
lola_proc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00