From: Jerin Jacob <jerinjacobk@gmail.com>
To: Ankur Dwivedi <adwivedi@marvell.com>
Cc: dev@dpdk.org, kirankumark@marvell.com, hkalra@marvell.com,
jerinj@marvell.com, stable@dpdk.org
Subject: Re: [PATCH v1] common/cnxk: fix integer overflow
Date: Mon, 22 Jul 2024 23:09:13 +0530 [thread overview]
Message-ID: <CALBAE1OwBsFaTQ2Wv6xn6u3NFLxB5xy6E9E2b4=dnKSekODQjw@mail.gmail.com> (raw)
In-Reply-To: <20240718063437.557134-1-adwivedi@marvell.com>
On Thu, Jul 18, 2024 at 12:13 PM Ankur Dwivedi <adwivedi@marvell.com> wrote:
>
> The expression flow_age->aging_poll_freq * NPC_AGE_WAIT_TIMEOUT_US is
> evaluated using 32 bit arithmetic. An integer overflow may occur when
> the value is too large to fit in 32 bits. This patch resolves this by
> casting flow_age->aging_poll_freq to 64 bit.
>
> Coverity issue: 428156
> Fixes: a4878294318e ("common/cnxk: fix flow aging on application exit")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Applied to dpdk-next-net-mrvl/for-main. Thanks
> ---
> drivers/common/cnxk/roc_npc_aging.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/common/cnxk/roc_npc_aging.c b/drivers/common/cnxk/roc_npc_aging.c
> index 1e85033e2a..258c15e341 100644
> --- a/drivers/common/cnxk/roc_npc_aging.c
> +++ b/drivers/common/cnxk/roc_npc_aging.c
> @@ -145,7 +145,7 @@ npc_age_wait_until(struct roc_npc_flow_age *flow_age)
> plt_delay_us(sleep);
> timeout += sleep;
> } while (!flow_age->aged_flows_get_thread_exit &&
> - (timeout < (flow_age->aging_poll_freq * NPC_AGE_WAIT_TIMEOUT_US)));
> + (timeout < ((uint64_t)flow_age->aging_poll_freq * NPC_AGE_WAIT_TIMEOUT_US)));
> }
>
> uint32_t
> --
> 2.25.1
>
prev parent reply other threads:[~2024-07-22 17:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-18 6:34 Ankur Dwivedi
2024-07-22 17:39 ` Jerin Jacob [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='CALBAE1OwBsFaTQ2Wv6xn6u3NFLxB5xy6E9E2b4=dnKSekODQjw@mail.gmail.com' \
--to=jerinjacobk@gmail.com \
--cc=adwivedi@marvell.com \
--cc=dev@dpdk.org \
--cc=hkalra@marvell.com \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--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).