DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mcnamara, John" <john.mcnamara@intel.com>
To: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Kumar Sanghvi <kumaras@chelsio.com>,
	Nirranjan Kirubaharan <nirranjan@chelsio.com>,
	Arjun V <arjun@chelsio.com>
Subject: Re: [dpdk-dev] DPDK Coverity issue 127559
Date: Tue, 19 Jul 2016 08:42:04 +0000	[thread overview]
Message-ID: <B27915DBBA3421428155699D51E4CFE2025A2D90@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <20160719081601.GA12140@chelsio.com>

> -----Original Message-----
> From: Rahul Lakkireddy [mailto:rahul.lakkireddy@chelsio.com]
> Sent: Tuesday, July 19, 2016 9:16 AM
> To: Mcnamara, John <john.mcnamara@intel.com>; dev@dpdk.org
> Cc: Kumar Sanghvi <kumaras@chelsio.com>; Nirranjan Kirubaharan
> <nirranjan@chelsio.com>; Arjun V <arjun@chelsio.com>
> Subject: Re: DPDK Coverity issue 127559
> 
> Hi all,
> 
> > 907     	if (err)
> > 908     		goto out;
> > 909
> > >>>     CID 127559:    (TAINTED_SCALAR)
> > >>>     Assigning: "p" = "(u32 *)buf". Both are now tainted.
> > 910     	for (p = (u32 *)buf; !err && aligned_len; aligned_len -= 4,
> p++) {
> > 911     		err = eeprom_wr_phys(adapter, aligned_offset, *p);
> > 912     		aligned_offset += 4;
> > 913     	}
> > 914
> > 915     	if (!err)
> >
> 
> I'm not an expert in Coverity and am having trouble understanding what the
> defect is and need some clarification.  Is it telling me that "buf"
> is being used without doing lower and upper bounds check?


Hi,

There is a lot more context when you view the defect through the Coverity web interface.

Basically it is saying that the data in buf comes from the user ("is tainted") and as such can't be trusted. Usually you need to provide some bound, or other, checks to protect against/untaint the data. However, in this case it looks like the data is coming from an eeprom rather than a "user" so it is probably a false positive.

However, you should look at the full context online and decide for yourself. Then update the status in the Coverity interface and add a comment on your decision.

John

      reply	other threads:[~2016-07-19  8:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201607041529.u64FTntT009098@sivswdev02.ir.intel.com>
2016-07-19  8:16 ` Rahul Lakkireddy
2016-07-19  8:42   ` Mcnamara, John [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=B27915DBBA3421428155699D51E4CFE2025A2D90@IRSMSX103.ger.corp.intel.com \
    --to=john.mcnamara@intel.com \
    --cc=arjun@chelsio.com \
    --cc=dev@dpdk.org \
    --cc=kumaras@chelsio.com \
    --cc=nirranjan@chelsio.com \
    --cc=rahul.lakkireddy@chelsio.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;
as well as URLs for NNTP newsgroup(s).