From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Nicolas Chautru <nicolas.chautru@intel.com>,
dev@dpdk.org, gakhil@marvell.com, hernan.vargas@intel.com
Subject: Re: [PATCH v1 2/6] baseband/acc: fix to possible overflow
Date: Wed, 2 Nov 2022 07:51:02 +0100 [thread overview]
Message-ID: <3daba34f-55d4-5038-fe46-aa2ef32b0fb5@redhat.com> (raw)
In-Reply-To: <20221101230459.50891-3-nicolas.chautru@intel.com>
On 11/2/22 00:04, Nicolas Chautru wrote:
> Potential overflow issue when casting to 64bits,
> notably relevant when extending number of queues.
>
> Coverity issue: 381665
> Fixes: 32e8b7ea35 ("baseband/acc100: refactor to segregate common code")
> Fixes: 40e3adbdd3 ("baseband/acc200: add queue configuration")
>
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> ---
> drivers/baseband/acc/rte_acc100_pmd.c | 3 +--
> drivers/baseband/acc/rte_acc200_pmd.c | 2 +-
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
> index 23bc5d25bb..b6e500c6bc 100644
> --- a/drivers/baseband/acc/rte_acc100_pmd.c
> +++ b/drivers/baseband/acc/rte_acc100_pmd.c
> @@ -888,8 +888,7 @@ acc100_queue_release(struct rte_bbdev *dev, uint16_t q_id)
>
> if (q != NULL) {
> /* Mark the Queue as un-assigned */
> - d->q_assigned_bit_map[q->qgrp_id] &= (0xFFFFFFFFFFFFFFFF -
> - (uint64_t) (1 << q->aq_id));
> + d->q_assigned_bit_map[q->qgrp_id] &= (~0ULL - (1 << (uint64_t) q->aq_id));
> rte_free(q->companion_ring_addr);
> rte_free(q->lb_in);
> rte_free(q->lb_out);
> diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c
> index 0cbb9a946b..76a5986448 100644
> --- a/drivers/baseband/acc/rte_acc200_pmd.c
> +++ b/drivers/baseband/acc/rte_acc200_pmd.c
> @@ -964,7 +964,7 @@ acc200_queue_release(struct rte_bbdev *dev, uint16_t q_id)
>
> if (q != NULL) {
> /* Mark the Queue as un-assigned. */
> - d->q_assigned_bit_map[q->qgrp_id] &= (~0ULL - (uint64_t) (1 << q->aq_id));
> + d->q_assigned_bit_map[q->qgrp_id] &= (~0ULL - (1 << (uint64_t) q->aq_id));
> rte_free(q->companion_ring_addr);
> rte_free(q->lb_in);
> rte_free(q->lb_out);
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
next prev parent reply other threads:[~2022-11-02 6:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 23:04 [PATCH v1 0/6] baseband/acc: fixes on top of RC2 Nicolas Chautru
2022-11-01 23:04 ` [PATCH v1 1/6] baseband/acc: fix LTE half iteration flag Nicolas Chautru
2022-11-02 6:32 ` Maxime Coquelin
2022-11-01 23:04 ` [PATCH v1 2/6] baseband/acc: fix to possible overflow Nicolas Chautru
2022-11-02 6:51 ` Maxime Coquelin [this message]
2022-11-01 23:04 ` [PATCH v1 3/6] baseband/acc: fix to acc200 access corner case Nicolas Chautru
2022-11-02 6:52 ` Maxime Coquelin
2022-11-01 23:04 ` [PATCH v1 4/6] baseband/acc: fix PMON register values Nicolas Chautru
2022-11-02 7:01 ` Maxime Coquelin
2022-11-01 23:04 ` [PATCH v1 5/6] baseband/acc: fix double MSI intr in TB mode Nicolas Chautru
2022-11-02 7:16 ` Maxime Coquelin
2022-11-01 23:04 ` [PATCH v1 6/6] baseband/acc: fix redundant function definition Nicolas Chautru
2022-11-02 7:19 ` Maxime Coquelin
2022-11-02 17:16 ` Chautru, Nicolas
2022-11-03 8:26 ` [EXT] [PATCH v1 0/6] baseband/acc: fixes on top of RC2 Akhil Goyal
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=3daba34f-55d4-5038-fe46-aa2ef32b0fb5@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=hernan.vargas@intel.com \
--cc=nicolas.chautru@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).