From: Tuo Li <islituo@gmail.com>
To: gregkh@linuxfoundation.org, jirislaby@kernel.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
"baijiaju1990@gmail.com" <baijiaju1990@gmail.com>
Subject: serial: sh-sci: Is there a potential buffer underflow in sci_dma_rx_complete()?
Date: Thu, 12 Aug 2021 16:10:24 +0800 [thread overview]
Message-ID: <0778c492-984e-b09e-cb1c-750c8256c346@gmail.com> (raw)
Hello,
Our static analysis tool reports a possible buffer underflow in sh-sci.c
in Linux 5.14.0-rc3:
The variable active is checked in:
1304: if (active >= 0)
This indicates that it can be negative.
If so, a possible buffer underflow will occur:
1312: desc = dmaengine_prep_slave_sg(s->chan_rx, &s->sg_rx[active],
1, ....);
However, I am not sure whether &s->sg_rx[active] will be used in
dmaengine_prep_slave_sg() if the
function sci_dma_rx_find_active() called at Line 1303 returns a negative
value (-1).
Any feedback would be appreciated, thanks!
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Best wishes,
Tuo Li
reply other threads:[~2021-08-12 8:10 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=0778c492-984e-b09e-cb1c-750c8256c346@gmail.com \
--to=islituo@gmail.com \
--cc=baijiaju1990@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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®