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 403E345AFB; Thu, 10 Oct 2024 04:53:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32E154029A; Thu, 10 Oct 2024 04:53:41 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id B0CBE4025C for ; Thu, 10 Oct 2024 04:53:40 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-20c6f492d2dso4144845ad.0 for ; Wed, 09 Oct 2024 19:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728528820; x=1729133620; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=uTBHIsfIEbvrBk9a3vqAdoZrXdJ/RFk/CBaXVJ3+XVA=; b=qDRV4dFDIhcjYE+a+TGIpzc/puuF/BLu1WOWYVRp1zLo+sBZffCqu5gU/1+5WhlIAA UEKH6EumKIxtoGxMoMMsWf/SmrxIvSgjq58TALV8c25I6zIBAYTZGB+/+uB6OXpPSQyZ zvjjFoPC2B1KIMK6dLyiXNxLF7sIosPYnLLgo7+YBOxjiTJOEjcA/nC0hTbZDiflPAdC bDPeKQFSUkVHywi4j/LgbqV3FDiCdoWq20HTdW4iEgeumItzqExa9NowzMjI1ny4x/Vp frMGLlh4JveYoKjxJ4z/2PGTipOKGWuD+xZsoDdSlQ/X6sZOJBKgcvnNNc9/j8Z/C+XL 8ABQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728528820; x=1729133620; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uTBHIsfIEbvrBk9a3vqAdoZrXdJ/RFk/CBaXVJ3+XVA=; b=acW/VTA0z1lk1C7zUwBpKogQxYYolVig1i2tBPE2AU6n2GM5zz2zbNZawArZUPtn4P ybbZO/1ZLBCEbKqJV+pWRc/qEhwtLjFMZ0Kwje26b7dj0d+zerd7J6dl+AbFLfblmhNz Zcy6K8f0E5VeVcNx33KVWvwErYV/j8galJDjzmdRig+MEhnM4NFFF5rq3vjMFIBr0Y9r MKmTS2uhkOe1fEXEoXaul4IlSK61q71k81+NcTJWS4Ef3YLTWhhRnowwsmRqUdWPe32Y FHZ5WzsjegbbqENo42rPUk25kyuvsm5ovbTs8v87xJjj0A46lC4O9jVfnF3K7jLF4DgZ qygA== X-Gm-Message-State: AOJu0YxCxUvL7zk1vHPEgynCRUhcm7MGgzbIPtarSCsIgtKy/UbK9mF7 rOam1P0g7IKR6+TEhvaEblz1nrmAx/BpgTksZEeOkj00JFFqP3XCuDh0ajoR2+M= X-Google-Smtp-Source: AGHT+IGWUUp7RiHvMrKmNsTTV2E6PqhqDldJ860l/Do0cyHLUWhwevkby3eqNcRTE3jvsL+wOn9WLA== X-Received: by 2002:a17:902:eccc:b0:20c:6399:d637 with SMTP id d9443c01a7336-20c6399e31dmr82131135ad.40.1728528819686; Wed, 09 Oct 2024 19:53:39 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8bc0d2edsm1164555ad.65.2024.10.09.19.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 19:53:39 -0700 (PDT) Date: Wed, 9 Oct 2024 19:53:37 -0700 From: Stephen Hemminger To: "Min Hu (Connor)" Cc: , , , , , , , , , Subject: Re: [dpdk-dev] [PATCH 10/10] net/bonding: fix configuration assignment overflow Message-ID: <20241009195337.07556977@hermes.local> In-Reply-To: <1618839289-33224-11-git-send-email-humin29@huawei.com> References: <1618839289-33224-1-git-send-email-humin29@huawei.com> <1618839289-33224-11-git-send-email-humin29@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Mon, 19 Apr 2021 21:34:49 +0800 "Min Hu (Connor)" wrote: > From: Chengchang Tang > > The expression may cause an overflow. > > This patch fix the codeDEX static check warning "INTEGER_OVERFLOW". > > Fixes: 46fb43683679 ("bond: add mode 4") > Cc: stable@dpdk.org > > Signed-off-by: Chengchang Tang > Signed-off-by: Min Hu (Connor) > --- > drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c > index 128754f..483f082 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -1237,7 +1237,7 @@ bond_mode_8023ad_conf_assign(struct mode8023ad_private *mode4, > mode4->aggregate_wait_timeout = conf->aggregate_wait_timeout_ms * ms_ticks; > mode4->tx_period_timeout = conf->tx_period_ms * ms_ticks; > mode4->rx_marker_timeout = conf->rx_marker_period_ms * ms_ticks; > - mode4->update_timeout_us = conf->update_timeout_ms * 1000; > + mode4->update_timeout_us = (uint64_t)conf->update_timeout_ms * 1000; It could overflow, but that would only happen if the timeout_ms was greater than 2^32 / 1000 which is 4295 seconds! The default is 100 ms. The driver should do some more validation in bond_8023ad_setup_validate(). It does check that update_timeout_ms is non zero, but it has no upper bound.