From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 33CD0A04DD for ; Wed, 28 Oct 2020 11:50:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2C2534CA7; Wed, 28 Oct 2020 11:50:03 +0100 (CET) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id B1C042C2A for ; Wed, 28 Oct 2020 11:49:59 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id t9so5118860wrq.11 for ; Wed, 28 Oct 2020 03:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8CykhCnkjycfL6pDo4XTJhMlpPDtKgNmWnEV135echM=; b=WhnaO+9A+NOYSfBgAcGs4mHqOUckLBZejikhE/cH7PtOoGQJG9Q6hixhJ6yNGxuSgh ux5b/CuNdNBZ0+BRf9rdtDZ9FT8SttMekW5fakEPL33EbaQTM6MZ522wgZJdAFELOhfJ HfANjusM/yp0ieam8fg2PbS/Z8WwtH42SdpNUgRuJTs403o62Nybjer3caVVrx9kzmhY D0Eo5jECqGt4UAi04m/MTrGLikuG8IWUVMDtgoN+8fQh+pfpPA5N9sTqfcT/7BWK3LAB pNcPIPPc+TrgquCjhyHABryE45k7MZkJpKkV6rlkQaqz3uYo/4LoXEfIwsWtaVw67idQ l4gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8CykhCnkjycfL6pDo4XTJhMlpPDtKgNmWnEV135echM=; b=CBA7u97QcP/gmL8pbYEfQBnxSK1Ujia2Ggtom7RJo8b/h9wQpGLD948oAN/fJZ6b08 HGUx0EObohmAE589+VgpkQ6ZrtY04lcB/YZHi+oicLBHHjmPlvQb5wXv59l8dBO2/D+2 K/DT4793RsHWn82AxBxrd+MLpNhBS6rG+828fHbPGPmgvzqHmSJOCv2ZSESEgGWSAOEc +kEJ9kUaXH+rQbdb2CiFknXmx3wDNJJcc0xF2SMXCt4Ry0zqI0qdTtjmYOlmobkqxBBh zXjO3qltTqJQwMhmMHkLWnKPXxn7N9BIQeelUoxBGZcLVWy/2slNhXa1RXAbn3MX16Up GaAw== X-Gm-Message-State: AOAM530UWjyn3NChr+Gs/zptUmPVfdlKTxYeaLMib2U4EYoYgC7/nP+n Yro5lCjVl6gl1E4QaJanj0zfb+ZaP5A5HqVP X-Google-Smtp-Source: ABdhPJwVYO0Sz/gbkYFClmTq4/W8QlTk8jJtv/KV4FCgnh8XKEXbETD6uW5a59To0YRNaeLzCWzy6Q== X-Received: by 2002:adf:9150:: with SMTP id j74mr8692348wrj.57.1603882198420; Wed, 28 Oct 2020 03:49:58 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id j17sm6252086wrw.68.2020.10.28.03.49.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:49:57 -0700 (PDT) From: luca.boccassi@gmail.com To: Somnath Kotur Cc: Venkat Duvvuru , Ajit Khaparde , dpdk stable Date: Wed, 28 Oct 2020 10:43:51 +0000 Message-Id: <20201028104606.3504127-72-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix shift operation' has been queued to stable release 19.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From aaccec59f821937ff1862f9b3600a3a4f8ef3796 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Tue, 22 Sep 2020 12:36:27 +0530 Subject: [PATCH] net/bnxt: fix shift operation [ upstream commit affb4d5c212957f3844a7bbd00a5f2ba703b8a33 ] In page_roundup() left shifting by more than 31 bits could have undefined behavior as the return value is int and in page_getenum() it is possible to return a value as high as 63. Fix that to cap the return value to less than 32. Coverity issue: 343463 Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF") Signed-off-by: Somnath Kotur Reviewed-by: Venkat Duvvuru Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 7695a6372f..1fcba99558 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -52,7 +52,7 @@ static int page_getenum(size_t size) if (size <= 1 << 30) return 30; PMD_DRV_LOG(ERR, "Page size %zu out of range\n", size); - return sizeof(void *) * 8 - 1; + return sizeof(int) * 8 - 1; } static int page_roundup(size_t size) -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:14.009969081 +0000 +++ 0072-net-bnxt-fix-shift-operation.patch 2020-10-28 10:35:11.568830966 +0000 @@ -1,8 +1,10 @@ -From affb4d5c212957f3844a7bbd00a5f2ba703b8a33 Mon Sep 17 00:00:00 2001 +From aaccec59f821937ff1862f9b3600a3a4f8ef3796 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Tue, 22 Sep 2020 12:36:27 +0530 Subject: [PATCH] net/bnxt: fix shift operation +[ upstream commit affb4d5c212957f3844a7bbd00a5f2ba703b8a33 ] + In page_roundup() left shifting by more than 31 bits could have undefined behavior as the return value is int and in page_getenum() it is possible to return a value as high as 63. @@ -10,7 +12,6 @@ Coverity issue: 343463 Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF") -Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Reviewed-by: Venkat Duvvuru @@ -20,7 +21,7 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c -index d0b820f149..577c5d1352 100644 +index 7695a6372f..1fcba99558 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -52,7 +52,7 @@ static int page_getenum(size_t size)