patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: David Marchand <david.marchand@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>,
	"Yang, Qiming" <qiming.yang@intel.com>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>,
	"Lu, Wenzhuo" <wenzhuo.lu@intel.com>
Subject: Re: [dpdk-stable] [PATCH] net/ice/base: fix mem allocations wrapper
Date: Sat, 8 May 2021 01:53:23 +0000	[thread overview]
Message-ID: <6635024c9de94923ae24e529226c543c@intel.com> (raw)
In-Reply-To: <20210506100702.23778-1-david.marchand@redhat.com>



> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Thursday, May 6, 2021 6:07 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>
> Subject: [PATCH] net/ice/base: fix mem allocations wrapper
> 
> This is reported by our internal covscan:
> 
> 1. dpdk-20.11/drivers/net/ice/base/ice_switch.c:4214: sign_extension:
> Suspicious implicit sign extension: "s_rule_size" with type "u16" (16 bits,
> unsigned) is promoted in "num_unicast * s_rule_size" to type "int"
> (32 bits, signed), then sign-extended to type "unsigned long" (64 bits,
> unsigned).
> If "num_unicast * s_rule_size" is greater than 0x7FFFFFFF, the upper bits of the
> result will all be 1.
> 
>  #  4212|   	s_rule_size = ICE_SW_RULE_RX_TX_ETH_HDR_SIZE;
>  #  4213|   	s_rule = (struct ice_aqc_sw_rules_elem *)
>  #  4214|-> 		ice_calloc(hw, num_unicast, s_rule_size);
>  #  4215|   	if (!s_rule) {
>  #  4216|   		status = ICE_ERR_NO_MEMORY;
> 
> Even if this condition is not likely to happen, in any case, it is more
> straightforward to rely on the existing rte_calloc.
> 
> Fixes: 5f0978e96220 ("net/ice/base: add OS specific implementation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi



      reply	other threads:[~2021-05-08  1:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 10:07 David Marchand
2021-05-08  1:53 ` Zhang, Qi Z [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=6635024c9de94923ae24e529226c543c@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@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
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).