Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/119316/?format=api
http://patchwork.dpdk.org/api/patches/119316/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20221031050516.2289622-1-junfeng.guo@intel.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20221031050516.2289622-1-junfeng.guo@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20221031050516.2289622-1-junfeng.guo@intel.com", "date": "2022-10-31T05:05:16", "name": "net/gve: fix pointers dereference before null check", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "7eb69bf472108199aee9cda1e614a765711dd610", "submitter": { "id": 1785, "url": "http://patchwork.dpdk.org/api/people/1785/?format=api", "name": "Junfeng Guo", "email": "junfeng.guo@intel.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20221031050516.2289622-1-junfeng.guo@intel.com/mbox/", "series": [ { "id": 25487, "url": "http://patchwork.dpdk.org/api/series/25487/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=25487", "date": "2022-10-31T05:05:16", "name": "net/gve: fix pointers dereference before null check", "version": 1, "mbox": "http://patchwork.dpdk.org/series/25487/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/119316/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/119316/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C0969A00C4;\n\tMon, 31 Oct 2022 06:07:12 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 61E3740151;\n\tMon, 31 Oct 2022 06:07:12 +0100 (CET)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id D948B400D5\n for <dev@dpdk.org>; Mon, 31 Oct 2022 06:07:10 +0100 (CET)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 30 Oct 2022 22:07:09 -0700", "from dpdk-jf-ntb-one.sh.intel.com ([10.67.111.104])\n by fmsmga006.fm.intel.com with ESMTP; 30 Oct 2022 22:07:08 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1667192831; x=1698728831;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=9w1TfoFqGnGu0cP+Xucj/QLCCsc09nImXZlhI5D4Pp4=;\n b=BYOFFOjN9353eTTYZXFZuQSKfVxmbj8ZPoOFmCgwT2Okym2sEWoDiF+X\n BDTikzNwh97DgZ7KWf6Y2s035SWxaSCPHNzOWW3v5N/iSJNUw5uriyVzn\n lrYbYuSZzNf2owG+3/bRPWb/4m38mEWDg1NLjVbHMg9Fg+3Ygh4hnj+16\n kv7fMcOE/a8I8F9yb1KvOxEfcP02rxf2/cQ7+RFw2O7grY5DuA2uwAJCD\n gsleAHtLwAjqdcg/zsO2EU5s8K5BzYDOjVw6bwzXeSJ/E/slsoEGf8bs+\n Nw/Azte5tWv0yKZY8UfooSg4a4YCramxcwYv3HQ4KlYYBdEl01NG1oeGh Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6500,9779,10516\"; a=\"335472574\"", "E=Sophos;i=\"5.95,227,1661842800\"; d=\"scan'208\";a=\"335472574\"", "E=McAfee;i=\"6500,9779,10516\"; a=\"878603381\"", "E=Sophos;i=\"5.95,227,1661842800\"; d=\"scan'208\";a=\"878603381\"" ], "X-ExtLoop1": "1", "From": "Junfeng Guo <junfeng.guo@intel.com>", "To": "qi.z.zhang@intel.com, jingjing.wu@intel.com, ferruh.yigit@xilinx.com,\n beilei.xing@intel.com", "Cc": "dev@dpdk.org,\n\tJunfeng Guo <junfeng.guo@intel.com>", "Subject": "[PATCH] net/gve: fix pointers dereference before null check", "Date": "Mon, 31 Oct 2022 13:05:16 +0800", "Message-Id": "<20221031050516.2289622-1-junfeng.guo@intel.com>", "X-Mailer": "git-send-email 2.34.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "The pointers 'rxq' and 'txq' are dereferenced before the null check.\nFixed the logic in this patch.\n\nFixes: 4bec2d0b5572 (\"net/gve: support queue operations\")\n\nSigned-off-by: Junfeng Guo <junfeng.guo@intel.com>\n---\n drivers/net/gve/gve_rx.c | 3 ++-\n drivers/net/gve/gve_tx.c | 3 ++-\n 2 files changed, 4 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c\nindex ea397d68fa..4c5b8c517d 100644\n--- a/drivers/net/gve/gve_rx.c\n+++ b/drivers/net/gve/gve_rx.c\n@@ -150,7 +150,7 @@ gve_rx_burst(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n static inline void\n gve_reset_rxq(struct gve_rx_queue *rxq)\n {\n-\tstruct rte_mbuf **sw_ring = rxq->sw_ring;\n+\tstruct rte_mbuf **sw_ring;\n \tuint32_t size, i;\n \n \tif (rxq == NULL) {\n@@ -166,6 +166,7 @@ gve_reset_rxq(struct gve_rx_queue *rxq)\n \tfor (i = 0; i < size; i++)\n \t\t((volatile char *)rxq->rx_data_ring)[i] = 0;\n \n+\tsw_ring = rxq->sw_ring;\n \tfor (i = 0; i < rxq->nb_rx_desc; i++)\n \t\tsw_ring[i] = NULL;\n \ndiff --git a/drivers/net/gve/gve_tx.c b/drivers/net/gve/gve_tx.c\nindex cd0bdaa2ad..4420a17192 100644\n--- a/drivers/net/gve/gve_tx.c\n+++ b/drivers/net/gve/gve_tx.c\n@@ -463,7 +463,7 @@ gve_tx_burst(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n static inline void\n gve_reset_txq(struct gve_tx_queue *txq)\n {\n-\tstruct rte_mbuf **sw_ring = txq->sw_ring;\n+\tstruct rte_mbuf **sw_ring;\n \tuint32_t size, i;\n \n \tif (txq == NULL) {\n@@ -475,6 +475,7 @@ gve_reset_txq(struct gve_tx_queue *txq)\n \tfor (i = 0; i < size; i++)\n \t\t((volatile char *)txq->tx_desc_ring)[i] = 0;\n \n+\tsw_ring = txq->sw_ring;\n \tfor (i = 0; i < txq->nb_tx_desc; i++) {\n \t\tsw_ring[i] = NULL;\n \t\tif (txq->is_gqi_qpl) {\n", "prefixes": [] }{ "id": 119316, "url": "