Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1305984/?format=api
{ "id": 1305984, "url": "http://patchwork.ozlabs.org/api/patches/1305984/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200609131945.18373-3-ciara.loftus@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20200609131945.18373-3-ciara.loftus@intel.com>", "list_archive_url": null, "date": "2020-06-09T13:19:45", "name": "[net,3/3] ice: protect ring accesses with WRITE_ONCE", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "35b4509181270c59b055d0cf1dd4f5ef8dd4b536", "submitter": { "id": 67255, "url": "http://patchwork.ozlabs.org/api/people/67255/?format=api", "name": "Ciara Loftus", "email": "ciara.loftus@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200609131945.18373-3-ciara.loftus@intel.com/mbox/", "series": [ { "id": 182261, "url": "http://patchwork.ozlabs.org/api/series/182261/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=182261", "date": "2020-06-09T13:19:43", "name": "[net,1/3] ixgbe: protect ring accesses with READ- and WRITE_ONCE", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/182261/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1305984/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1305984/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)", "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49hB8s1f1nz9sRK\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 9 Jun 2020 23:41:01 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id A50B7868CA;\n\tTue, 9 Jun 2020 13:40:59 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id K6zdXn9S1GjB; Tue, 9 Jun 2020 13:40:55 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id CCBBB8672C;\n\tTue, 9 Jun 2020 13:40:55 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n by ash.osuosl.org (Postfix) with ESMTP id AB7101BF5AA\n for <intel-wired-lan@lists.osuosl.org>; Tue, 9 Jun 2020 13:40:54 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by silver.osuosl.org (Postfix) with ESMTP id A3C2C22812\n for <intel-wired-lan@lists.osuosl.org>; Tue, 9 Jun 2020 13:40:54 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id Epj3vYuzXxG8 for <intel-wired-lan@lists.osuosl.org>;\n Tue, 9 Jun 2020 13:40:53 +0000 (UTC)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by silver.osuosl.org (Postfix) with ESMTPS id 273D820468\n for <intel-wired-lan@lists.osuosl.org>; Tue, 9 Jun 2020 13:40:53 +0000 (UTC)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Jun 2020 06:40:52 -0700", "from silpixa00399839.ir.intel.com (HELO localhost.localdomain)\n ([10.237.222.8])\n by fmsmga004.fm.intel.com with ESMTP; 09 Jun 2020 06:40:51 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "IronPort-SDR": [ "\n kq5fnCEd/7br1Dvpf7mbWS5gj6J1DnCwY3ejBV848VXskFCPJR5MIYGIS1mvmolVwwwkNeUFMb\n 8cmc6rP62ixw==", "\n mpyT7sZhMKlrLlo0YzHV3LqvTaMfSV/lMAZxvBsqN/vdYSjm1gfC6tcrcAYOXXdBrgo7cfNh8y\n 58XQCT5fgyuQ==" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.73,492,1583222400\"; d=\"scan'208\";a=\"295837460\"", "From": "Ciara Loftus <ciara.loftus@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 9 Jun 2020 13:19:45 +0000", "Message-Id": "<20200609131945.18373-3-ciara.loftus@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200609131945.18373-1-ciara.loftus@intel.com>", "References": "<20200609131945.18373-1-ciara.loftus@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH net 3/3] ice: protect ring accesses with\n WRITE_ONCE", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Cc": "netdev@vger.kernel.org, bjorn.topel@intel.com, magnus.karlsson@intel.com", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "The READ_ONCE macro is used when reading rings prior to accessing the\nstatistics pointer. The corresponding WRITE_ONCE usage when allocating and\nfreeing the rings to ensure protected access was not in place. Introduce\nthis.\n\nSigned-off-by: Ciara Loftus <ciara.loftus@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_lib.c | 8 ++++----\n drivers/net/ethernet/intel/ice/ice_main.c | 2 +-\n 2 files changed, 5 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 28b46cc9f5cb..2e3a39cea2c0 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -1194,7 +1194,7 @@ static void ice_vsi_clear_rings(struct ice_vsi *vsi)\n \t\tfor (i = 0; i < vsi->alloc_txq; i++) {\n \t\t\tif (vsi->tx_rings[i]) {\n \t\t\t\tkfree_rcu(vsi->tx_rings[i], rcu);\n-\t\t\t\tvsi->tx_rings[i] = NULL;\n+\t\t\t\tWRITE_ONCE(vsi->tx_rings[i], NULL);\n \t\t\t}\n \t\t}\n \t}\n@@ -1202,7 +1202,7 @@ static void ice_vsi_clear_rings(struct ice_vsi *vsi)\n \t\tfor (i = 0; i < vsi->alloc_rxq; i++) {\n \t\t\tif (vsi->rx_rings[i]) {\n \t\t\t\tkfree_rcu(vsi->rx_rings[i], rcu);\n-\t\t\t\tvsi->rx_rings[i] = NULL;\n+\t\t\t\tWRITE_ONCE(vsi->rx_rings[i], NULL);\n \t\t\t}\n \t\t}\n \t}\n@@ -1235,7 +1235,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)\n \t\tring->vsi = vsi;\n \t\tring->dev = dev;\n \t\tring->count = vsi->num_tx_desc;\n-\t\tvsi->tx_rings[i] = ring;\n+\t\tWRITE_ONCE(vsi->tx_rings[i], ring);\n \t}\n \n \t/* Allocate Rx rings */\n@@ -1254,7 +1254,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)\n \t\tring->netdev = vsi->netdev;\n \t\tring->dev = dev;\n \t\tring->count = vsi->num_rx_desc;\n-\t\tvsi->rx_rings[i] = ring;\n+\t\tWRITE_ONCE(vsi->rx_rings[i], ring);\n \t}\n \n \treturn 0;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 082825e3cb39..4cbd49c87568 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -1702,7 +1702,7 @@ static int ice_xdp_alloc_setup_rings(struct ice_vsi *vsi)\n \t\txdp_ring->netdev = NULL;\n \t\txdp_ring->dev = dev;\n \t\txdp_ring->count = vsi->num_tx_desc;\n-\t\tvsi->xdp_rings[i] = xdp_ring;\n+\t\tWRITE_ONCE(vsi->xdp_rings[i], xdp_ring);\n \t\tif (ice_setup_tx_ring(xdp_ring))\n \t\t\tgoto free_xdp_rings;\n \t\tice_set_ring_xdp(xdp_ring);\n", "prefixes": [ "net", "3/3" ] }