From: Tuo Li <islituo@gmail.com>
To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl,
christophe.jaillet@wanadoo.fr, tglx@linutronix.de
Cc: linux-media@vger.kernel.org,
Linux Kernel <linux-kernel@vger.kernel.org>,
"baijiaju1990@gmail.com" <baijiaju1990@gmail.com>
Subject: [media] cx25821: Is there a potential buffer-underflow in cx25821-core.c?
Date: Thu, 12 Aug 2021 12:21:35 +0800 [thread overview]
Message-ID: <22f3bdcb-dc29-b6a7-941e-6218f0a8791d@gmail.com> (raw)
Hello,
Our static analysis tool reports a possible buffer-underflow in
cx25821-core.c in Linux 5.14.0-rc3:
The variable channel_select is checked in:
761: if (channel_select <= 7 && channel_select >= 0)
This indicates that channel_select can be negative.
If so, a buffer-underflow will occur:
765: dev->channels[channel_select].pixel_formats = format;
However, we checked this report manually, and found that the only call
site is in cx25821-video.c:
394: cx25821_set_pixel_format(dev, SRAM_CH00, pix_format);
And SRAM_CH00 is not negative.
I am not sure whether this negatvie-check is redundant or there is a
potential buffer-underflow.
Any feedback would be appreciated, thanks!
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Best wishes,
Tuo Li
reply other threads:[~2021-08-12 4:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=22f3bdcb-dc29-b6a7-941e-6218f0a8791d@gmail.com \
--to=islituo@gmail.com \
--cc=baijiaju1990@gmail.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).