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 4D62AA0032 for ; Fri, 18 Feb 2022 13:41:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4806040E28; Fri, 18 Feb 2022 13:41:19 +0100 (CET) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mails.dpdk.org (Postfix) with ESMTP id D8E3E40141 for ; Fri, 18 Feb 2022 13:41:17 +0100 (CET) Received: by mail-wr1-f47.google.com with SMTP id o24so14399266wro.3 for ; Fri, 18 Feb 2022 04:41:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9LFlOKdDMKjEvsJ0rlHZQZgE4kimzVk796VtF6XWg5g=; b=gHsbWKamRBKo6/GEcht0YdTBFck+/fKa75+Z/whA5HbQajAyhiNlWGIpLnYO+rrF9A cjCKIWjO2eda+AcKvQX+qDhEbV5HqyuiA538/uBY775gP+RY3n7iGU/9/JUYKXhzbqzO h8qh6CVb9/jTJhKH7OodBygvI2yUtZ2W5l9pthW4x4odD5r5cra2IrClVdv8kUpF+cpA Yk3r6jmT8dntc0oYXLF7GRrGQkm1nHeevyismDT824Rt3dkNYYNlx19iV/NykLBjdCSW jlz3gTjyX8SdZ0pXWS67g+Wz2yE7RqvkfZTIhaDP1is9ooT+h8Z2gFumz0cv14F0IFqS 0mYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9LFlOKdDMKjEvsJ0rlHZQZgE4kimzVk796VtF6XWg5g=; b=1Pa5X4em5lgavBl2O4jNLy9tQuZK9khXhOQSxRCQWa+epiUSOB9axa8eATgHHQemp5 voRQYoDlxX0SLUyxqdBwXfKAau2dOENCHPDDXJdgmZDFj2wVDJsNk5Q8E6OaUx9I8dG+ doXnBFHtHkdANBFmV8LGT5/6kB9f0C5NfUMN9J80AprUUelybca99duAsUMjnSpIa3fw MEA9SGy3yO3k5WW7ti4WhRb54DBY6itpkHrhKy+qM3BVdRSO1JNGw+0zmPO4giwg9k1S jqkHbR2XWVkuwK9RKbf2W0Ru91oCIHA1LC/6UX3lAm7apQ7Mql8xXCUyuJrwla6+4fKZ YI4A== X-Gm-Message-State: AOAM533Gn8qTsMK1r0T6VJJuoTSKDksTfbeMqkFCaQX7p5NYXFfAagME i3ucrC/R06aPk+BtWpSrHVw= X-Google-Smtp-Source: ABdhPJwaLUEM4D2wzBg6yy9M9XybeZslcq+sGIP4uQNKdXFX1mvdJ00dM79cuC7DNU+8n45zYYD+jw== X-Received: by 2002:adf:e705:0:b0:1e3:14aa:db8d with SMTP id c5-20020adfe705000000b001e314aadb8dmr5800080wrm.398.1645188077546; Fri, 18 Feb 2022 04:41:17 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id f7sm34938280wrz.40.2022.02.18.04.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:41:17 -0800 (PST) From: luca.boccassi@gmail.com To: Ajit Khaparde Cc: Kalesh AP , Somnath Kotur , dpdk stable Subject: patch 'net/bnxt: check VF representor pointer before access' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:38:03 +0000 Message-Id: <20220218123931.1749595-34-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 20.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/22. 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. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/e93a5f44791de38dd652eeb8d5d6984188dcb3b7 Thanks. Luca Boccassi --- >From e93a5f44791de38dd652eeb8d5d6984188dcb3b7 Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Tue, 4 Jan 2022 14:08:24 +0530 Subject: [PATCH] net/bnxt: check VF representor pointer before access [ upstream commit f30622542ccfe5e9ba31f67972e999c99e73385b ] The PF or trusted VF Rx handler could invoke the VF representor's Rx function without knowledge of the application cleaning up the representor ports. Check if the vfr_bp pointer is valid before accessing it. Fixes: 6dc83230b43b ("net/bnxt: support port representor data path") Signed-off-by: Ajit Khaparde Reviewed-by: Kalesh AP Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_reps.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c index b9b0f62c9c..db780c3d2c 100644 --- a/drivers/net/bnxt/bnxt_reps.c +++ b/drivers/net/bnxt/bnxt_reps.c @@ -35,16 +35,20 @@ static const struct eth_dev_ops bnxt_rep_dev_ops = { uint16_t bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf) { - struct rte_mbuf **prod_rx_buf; + struct bnxt_representor *vfr_bp = NULL; struct bnxt_rx_ring_info *rep_rxr; - struct bnxt_rx_queue *rep_rxq; struct rte_eth_dev *vfr_eth_dev; - struct bnxt_representor *vfr_bp; + struct rte_mbuf **prod_rx_buf; + struct bnxt_rx_queue *rep_rxq; uint16_t mask; uint8_t que; vfr_eth_dev = &rte_eth_devices[port_id]; - vfr_bp = vfr_eth_dev->data->dev_private; + vfr_bp = vfr_eth_dev ? vfr_eth_dev->data->dev_private : NULL; + + if (unlikely(vfr_bp == NULL)) + return 1; + /* If rxq_id happens to be > nr_rings, use ring 0 */ que = queue_id < vfr_bp->rx_nr_rings ? queue_id : 0; rep_rxq = vfr_bp->rx_queues[que]; -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:39.438341054 +0000 +++ 0034-net-bnxt-check-VF-representor-pointer-before-access.patch 2022-02-18 12:37:37.618790312 +0000 @@ -1 +1 @@ -From f30622542ccfe5e9ba31f67972e999c99e73385b Mon Sep 17 00:00:00 2001 +From e93a5f44791de38dd652eeb8d5d6984188dcb3b7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f30622542ccfe5e9ba31f67972e999c99e73385b ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index f24f5ef75f..5e140f0cdb 100644 +index b9b0f62c9c..db780c3d2c 100644