patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Wei Huang <wei.huang@intel.com>,
	dev@dpdk.org, rosen.xu@intel.com, qi.z.zhang@intel.com
Cc: stable@dpdk.org, tianfei.zhang@intel.com
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v1 1/2] raw/ifpga/base: use untained variable as argument
Date: Wed, 7 Apr 2021 15:57:14 +0100
Message-ID: <6eb2400f-0edb-c9a5-d3ae-1881ae49efff@intel.com> (raw)
In-Reply-To: <1615969417-17118-2-git-send-email-wei.huang@intel.com>

On 3/17/2021 8:23 AM, Wei Huang wrote:
> In fme_spi_init(), passing tainted expression "fme->max10_dev"
> to function "intel_max10_device_remove" has risk. Untainted
> variable "max10" should be used.
> 
> Coverity issue: 367480
> Fixes: 96ebfcf8125c ("raw/ifpga/base: add SPI and MAX10 device driver")
> 

Following is from the coverity:
2. tainted_return_value: Function intel_max10_device_probe returns tainted data.
3. var_assign: Assigning: max10 = intel_max10_device_probe(spi_master, 0), which 
taints max10
5. var_assign_var: Assigning: fme->max10_dev = max10. Both are now tainted.


'max10' is tainted at first place, and 'fme->max10_dev' is tainted because of 
'max10'. In this case how replacing 'fme->max10_dev' with 'max10' helps?

Did you verified that change is fixing the coverity issue?


And as the previous one, what is the exact problem, what is tainted data and how 
it is a problem, can you please describe?

> Signed-off-by: Wei Huang <wei.huang@intel.com>
> ---
>   drivers/raw/ifpga/base/ifpga_fme.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/ifpga/base/ifpga_fme.c b/drivers/raw/ifpga/base/ifpga_fme.c
> index 43c7b9c3dc..a63f90331f 100644
> --- a/drivers/raw/ifpga/base/ifpga_fme.c
> +++ b/drivers/raw/ifpga/base/ifpga_fme.c
> @@ -1001,7 +1001,7 @@ static int fme_spi_init(struct ifpga_feature *feature)
>   	return ret;
>   
>   max10_fail:
> -	intel_max10_device_remove(fme->max10_dev);
> +	intel_max10_device_remove(max10);
>   spi_fail:
>   	altera_spi_release(spi_master);
>   	return ret;
> 


  parent reply	other threads:[~2021-04-07 14:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17  8:23 [dpdk-stable] [PATCH v1 0/2] Fix coverity issues reported in DPDK-26381 Wei Huang
2021-03-17  8:23 ` [dpdk-stable] [PATCH v1 1/2] raw/ifpga/base: use untained variable as argument Wei Huang
2021-04-01  7:48   ` Zhang, Tianfei
2021-04-01  8:48   ` Xu, Rosen
2021-04-07 14:57   ` Ferruh Yigit [this message]
2021-03-17  8:23 ` [dpdk-stable] [PATCH v1 2/2] raw/ifpga/base: add argument to use untained variable Wei Huang
2021-04-01  7:48   ` Zhang, Tianfei
2021-04-01  8:48   ` Xu, Rosen
2021-04-01 12:17 ` [dpdk-stable] [PATCH v1 0/2] Fix coverity issues reported in DPDK-26381 Zhang, Qi Z
2021-04-20  8:09   ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2021-04-20  9:12     ` Zhang, Qi Z
2021-04-20  9:29       ` Zhang, Qi Z

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=6eb2400f-0edb-c9a5-d3ae-1881ae49efff@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=rosen.xu@intel.com \
    --cc=stable@dpdk.org \
    --cc=tianfei.zhang@intel.com \
    --cc=wei.huang@intel.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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git