From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7502645683; Mon, 22 Jul 2024 19:39:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61AD74067C; Mon, 22 Jul 2024 19:39:41 +0200 (CEST) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) by mails.dpdk.org (Postfix) with ESMTP id 717CA4028B; Mon, 22 Jul 2024 19:39:40 +0200 (CEST) Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-447d97f98d3so20799211cf.2; Mon, 22 Jul 2024 10:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721669980; x=1722274780; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GJPlohCO5SI6WhCitO0fKDoN0NGkpJZnVIYA3c/KuW4=; b=GReFWfmJVmvIwebqZAev6PPRecux4vo+7Xl3KUXdwDudk0if9Wno9anzIkPC9g9tlV bP+i3j77ZlxK4Tlj4wTsOp95zgwkoG5Lia8/ZNS+Z2zsZ3YJ0+E6K1BQy3f+YhYAKcHY KYDvkWx3iJRElHp6udvtY8KS7yTkkwmlnukh054QyWILUVYfQ6UoB2afAyut0XzOfXAF kjlAI6lrxk24NRIKdxPtLeEzRCG+uUlSpoHVQc+Ti8+FaxqmLKH5ayuSMj6YtDFZmjHP MWEsRuaVU00zquJLQ3I6/mR4nvBwbzRA8NflOcAKLUTgKZXbFv1/Ut9orq1pxovaFrPC qjiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721669980; x=1722274780; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GJPlohCO5SI6WhCitO0fKDoN0NGkpJZnVIYA3c/KuW4=; b=TtZbLjUBMvNN3N4brQQqnpkx+H/botVKLvvHVWCBk4MtVLfJ3IWLfeouOrgTRNJ+Yn Ld6WQLnAkiGz67Fw4Pkx1NR9VrUz0OggLCnT3qWoGyTjqTWKjMeGsVIlIl1obnSC64OB kz0hJvoGGBMYm5mapQ4dOyEtykXbCDmQoM7GLw+L3Aq1c+x4UhPjCt8uU+ko9u1pPcEA viz6IG4jXHTwelhTWFMjDUhk7DZk+nzp185w+pg4wEN+3Y80cTH6jfG//827ip6m6BEc hHMZsBv98Kdea/Urs232ofQwmGmSsgnwVJyYlpKfWceAb162YtbGlfm5oHvTHxQKWaAR 4x6Q== X-Forwarded-Encrypted: i=1; AJvYcCVPHosXdZHSE1KgKKVsSIO/RBEwwC9hLycoNN/W7DhRZJUAjZHT8RzUkRvMG+z29qU0SDo9+TRSktdOazx8TZQ= X-Gm-Message-State: AOJu0Yyopo4Khq9WUckpfiZ2Uu6cBYc9XOqV5pbtBHwXszlnlzbK7ofx GuhnaXIiX5eg4/98qsKntav4ab1+mJqncFS4nNVS6srgiqZfBXpOC4JVgifTtFFwCIDizjX4z8B 861eNL4SZWDBWLgh0TxVXWh9otQEZHpsKWcY= X-Google-Smtp-Source: AGHT+IGaVeH1B3FzwlbLNr9kiOTEvZPe1Q/s57kydWLSe0XMxQwlZ47A7XxuBXCDufm2Jdr7PG5Oe52veBr6xPnRBGo= X-Received: by 2002:a05:622a:3d4:b0:447:e890:b1a0 with SMTP id d75a77b69052e-44fc55166cfmr6305301cf.14.1721669979565; Mon, 22 Jul 2024 10:39:39 -0700 (PDT) MIME-Version: 1.0 References: <20240718063437.557134-1-adwivedi@marvell.com> In-Reply-To: <20240718063437.557134-1-adwivedi@marvell.com> From: Jerin Jacob Date: Mon, 22 Jul 2024 23:09:13 +0530 Message-ID: Subject: Re: [PATCH v1] common/cnxk: fix integer overflow To: Ankur Dwivedi Cc: dev@dpdk.org, kirankumark@marvell.com, hkalra@marvell.com, jerinj@marvell.com, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Jul 18, 2024 at 12:13=E2=80=AFPM Ankur Dwivedi 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 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/ro= c_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 +=3D sleep; > } while (!flow_age->aged_flows_get_thread_exit && > - (timeout < (flow_age->aging_poll_freq * NPC_AGE_WAIT_TIM= EOUT_US))); > + (timeout < ((uint64_t)flow_age->aging_poll_freq * NPC_AG= E_WAIT_TIMEOUT_US))); > } > > uint32_t > -- > 2.25.1 >