patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Hunt <david.hunt@intel.com>
To: Bruce Richardson <bruce.richardson@intel.com>, <dev@dpdk.org>
Cc: <stable@dpdk.org>
Subject: Re: [PATCH] distributor: fix potential overflow bug
Date: Thu, 17 Feb 2022 15:24:02 +0000	[thread overview]
Message-ID: <153e9fb1-8568-1c82-0281-ca74bce0376d@intel.com> (raw)
In-Reply-To: <20220217150239.69876-1-bruce.richardson@intel.com>

Hi Bruce,

On 17/2/2022 3:02 PM, Bruce Richardson wrote:
> Coverity flags the fact that the tag values used in distributor are
> 32-bit, which means that when we use bit-manipulation to convert a tag
> match/no-match to a bit in an array, we need to typecast to a 64-bit
> type before shifting past 32 bits.
>
> Coverity issue: 375808
> Fixes: 08ccf3faa6a9 ("distributor: new packet distributor library")
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>   lib/distributor/rte_distributor_single.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/lib/distributor/rte_distributor_single.c b/lib/distributor/rte_distributor_single.c
> index b653620688..60ca86152f 100644
> --- a/lib/distributor/rte_distributor_single.c
> +++ b/lib/distributor/rte_distributor_single.c
> @@ -247,8 +247,7 @@ rte_distributor_process_single(struct rte_distributor_single *d,
>   			 * worker given by the bit-position
>   			 */
>   			for (i = 0; i < d->num_workers; i++)
> -				match |= (!(d->in_flight_tags[i] ^ new_tag)
> -					<< i);
> +				match |= ((uint64_t)!(d->in_flight_tags[i] ^ new_tag) << i);
>   
>   			/* Only turned-on bits are considered as match */
>   			match &= d->in_flight_bitmask;


LGTM

Acked-by: David Hunt <david.hunt@intel.com>



  reply	other threads:[~2022-02-17 15:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 15:02 Bruce Richardson
2022-02-17 15:24 ` David Hunt [this message]
2022-02-27 18:07   ` Thomas Monjalon

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=153e9fb1-8568-1c82-0281-ca74bce0376d@intel.com \
    --to=david.hunt@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).