mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tuo Li <islituo@gmail.com>
To: "Dalessandro, Dennis" <dennis.dalessandro@cornelisnetworks.com>,
	mike.marciniszyn@cornelisnetworks.com, dledford@redhat.com,
	"jgg@ziepe.ca" <jgg@ziepe.ca>
Cc: linux-rdma@vger.kernel.org,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	"baijiaju1990@gmail.com" <baijiaju1990@gmail.com>
Subject: [BUG] RDMA/hw/qib/qib_iba6120: possible buffer underflow in rcvctrl_6120_mod()
Date: Thu, 12 Aug 2021 15:35:53 +0800	[thread overview]
Message-ID: <9c03a5f4-865b-000e-0206-9e01f876261a@gmail.com> (raw)

Hello,

Our static analysis tool reports a possible buffer underflow in 
qib_iba6120.c in Linux 5.14.0-rc3:

The variable ctxt is checked in:
2110:    if (ctxt < 0)

This indicates that ctxt can be negative.
If so, possible buffer underflows will occur:
2120:    qib_write_kreg_ctxt(dd, kr_rcvhdrtailaddr, ctxt, 
dd->rcd[ctxt]->rcvhdrqtailaddr_phys);
2122:    qib_write_kreg_ctxt(dd, kr_rcvhdraddr, ctxt, 
dd->rcd[ctxt]->rcvhdrq_phys);

However, I am not sure whether ctxt < 0 and op & QIB_RCVCTRL_CTXT_ENB 
can be true at the same time.

Any feedback would be appreciated, thanks!

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>

Best wishes,
Tuo Li

             reply	other threads:[~2021-08-12  7:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12  7:35 Tuo Li [this message]
2021-08-17 18:37 ` Marciniszyn, Mike
2021-08-17 18:46   ` Marciniszyn, Mike

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=9c03a5f4-865b-000e-0206-9e01f876261a@gmail.com \
    --to=islituo@gmail.com \
    --cc=baijiaju1990@gmail.com \
    --cc=dennis.dalessandro@cornelisnetworks.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mike.marciniszyn@cornelisnetworks.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®