[dpdk-dev] DPDK Coverity issue 127559

Mcnamara, John john.mcnamara at intel.com
Tue Jul 19 10:42:04 CEST 2016


> -----Original Message-----
> From: Rahul Lakkireddy [mailto:rahul.lakkireddy at chelsio.com]
> Sent: Tuesday, July 19, 2016 9:16 AM
> To: Mcnamara, John <john.mcnamara at intel.com>; dev at dpdk.org
> Cc: Kumar Sanghvi <kumaras at chelsio.com>; Nirranjan Kirubaharan
> <nirranjan at chelsio.com>; Arjun V <arjun at 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





More information about the dev mailing list