From: Takashi Iwai <tiwai@suse.de>
To: Kees Cook <keescook@chromium.org>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH] ALSA: lola: Bounds check loop iterator against streams array size
Date: Sat, 21 May 2022 08:49:20 +0200 [thread overview]
Message-ID: <87wnefnzwv.wl-tiwai@suse.de> (raw)
In-Reply-To: <20220520165537.2139826-1-keescook@chromium.org>
On Fri, 20 May 2022 18:55:37 +0200,
Kees Cook wrote:
>
> 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];
> | ^~~~~~~
>
> 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>
Thanks, applied now.
Takashi
prev parent reply other threads:[~2022-05-21 6:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-20 16:55 Kees Cook
2022-05-21 6:49 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wnefnzwv.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®