Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1612159/?format=api
{ "id": 1612159, "url": "http://patchwork.ozlabs.org/api/patches/1612159/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20220401104052.1711721-1-ivecera@redhat.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": "<20220401104052.1711721-1-ivecera@redhat.com>", "list_archive_url": null, "date": "2022-04-01T10:40:52", "name": "[net,v2] ice: Fix incorrect locking in ice_vc_process_vf_msg()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "3d9cd1005d0cdfa77aa3bfe37347a4af69667a20", "submitter": { "id": 262, "url": "http://patchwork.ozlabs.org/api/people/262/?format=api", "name": "Ivan Vecera", "email": "ivecera@redhat.com" }, "delegate": { "id": 109701, "url": "http://patchwork.ozlabs.org/api/users/109701/?format=api", "username": "anguy11", "first_name": "Anthony", "last_name": "Nguyen", "email": "anthony.l.nguyen@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20220401104052.1711721-1-ivecera@redhat.com/mbox/", "series": [ { "id": 293064, "url": "http://patchwork.ozlabs.org/api/series/293064/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=293064", "date": "2022-04-01T10:40:52", "name": "[net,v2] ice: Fix incorrect locking in ice_vc_process_vf_msg()", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/293064/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1612159/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1612159/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": [ "bilbo.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=BBPiIVWZ;\n\tdkim-atps=neutral", "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)" ], "Received": [ "from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby bilbo.ozlabs.org (Postfix) with ESMTPS id 4KVGtJ1k7Rz9sGC\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 1 Apr 2022 21:41:11 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id BEACC41E86;\n\tFri, 1 Apr 2022 10:41:09 +0000 (UTC)", "from smtp4.osuosl.org ([127.0.0.1])\n\tby localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id hAzTQ9Nh-PzR; Fri, 1 Apr 2022 10:41:08 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 72EDF41E87;\n\tFri, 1 Apr 2022 10:41:08 +0000 (UTC)", "from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by ash.osuosl.org (Postfix) with ESMTP id 5FFC71BF861\n for <intel-wired-lan@lists.osuosl.org>; Fri, 1 Apr 2022 10:41:07 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id 4D7C541E86\n for <intel-wired-lan@lists.osuosl.org>; Fri, 1 Apr 2022 10:41:07 +0000 (UTC)", "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id vAvrdG43LCHh for <intel-wired-lan@lists.osuosl.org>;\n Fri, 1 Apr 2022 10:41:06 +0000 (UTC)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by smtp4.osuosl.org (Postfix) with ESMTPS id 675D841E85\n for <intel-wired-lan@lists.osuosl.org>; Fri, 1 Apr 2022 10:41:06 +0000 (UTC)", "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-442-ewtEnXRZPAqk3RJgynQXIA-1; Fri, 01 Apr 2022 06:41:00 -0400", "from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com\n [10.11.54.3])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 84BCA811E83;\n Fri, 1 Apr 2022 10:40:59 +0000 (UTC)", "from ceranb.redhat.com (unknown [10.40.192.123])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 0DEC21121315;\n Fri, 1 Apr 2022 10:40:52 +0000 (UTC)" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.8.0", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1648809665;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=DjkNl878MF0d7RU+70oPmG5s+v89O1lNqPhsXPb8x2M=;\n b=BBPiIVWZ9wKPY0zLi4WDB1ssrVHgnE3Z0UP2P0ZqrTbs0mcLkx6IARVQo6lrlY04uoDoOF\n wF4lbLICAec7p3/48cF3Ap0SS1IFx/qh9Bz17+UwKLAuckgDa6AsnDRFPoSZfKPo3G7UL5\n 6NrAfUtm6QXiAgAZe9pZJWD1qypZ0Is=", "X-MC-Unique": "ewtEnXRZPAqk3RJgynQXIA-1", "From": "Ivan Vecera <ivecera@redhat.com>", "To": "netdev@vger.kernel.org", "Date": "Fri, 1 Apr 2022 12:40:52 +0200", "Message-Id": "<20220401104052.1711721-1-ivecera@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.78 on 10.11.54.3", "Subject": "[Intel-wired-lan] [PATCH net v2] ice: Fix incorrect locking in\n ice_vc_process_vf_msg()", "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": "\"moderated list:INTEL ETHERNET DRIVERS\"\n <intel-wired-lan@lists.osuosl.org>,\n mschmidt@redhat.com, Brett Creeley <brett.creeley@intel.com>,\n open list <linux-kernel@vger.kernel.org>, poros@redhat.com,\n Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,\n \"David S. Miller\" <davem@davemloft.net>", "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": "Usage of mutex_trylock() in ice_vc_process_vf_msg() is incorrect\nbecause message sent from VF is ignored and never processed.\n\nUse mutex_lock() instead to fix the issue. It is safe because this\nmutex is used to prevent races between VF related NDOs and\nhandlers processing request messages from VF and these handlers\nare running in ice_service_task() context. Additionally move this\nmutex lock prior ice_vc_is_opcode_allowed() call to avoid potential\nraces during allowlist acccess.\n\nFixes: e6ba5273d4ed (\"ice: Fix race conditions between virtchnl handling and VF ndo ops\")\nSigned-off-by: Ivan Vecera <ivecera@redhat.com>\n---\n drivers/net/ethernet/intel/ice/ice_virtchnl.c | 21 +++++++------------\n 1 file changed, 7 insertions(+), 14 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c\nindex 3f1a63815bac..a465f3743ffc 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c\n@@ -3642,14 +3642,6 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \t\t\terr = -EINVAL;\n \t}\n \n-\tif (!ice_vc_is_opcode_allowed(vf, v_opcode)) {\n-\t\tice_vc_send_msg_to_vf(vf, v_opcode,\n-\t\t\t\t VIRTCHNL_STATUS_ERR_NOT_SUPPORTED, NULL,\n-\t\t\t\t 0);\n-\t\tice_put_vf(vf);\n-\t\treturn;\n-\t}\n-\n error_handler:\n \tif (err) {\n \t\tice_vc_send_msg_to_vf(vf, v_opcode, VIRTCHNL_STATUS_ERR_PARAM,\n@@ -3660,12 +3652,13 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \t\treturn;\n \t}\n \n-\t/* VF is being configured in another context that triggers a VFR, so no\n-\t * need to process this message\n-\t */\n-\tif (!mutex_trylock(&vf->cfg_lock)) {\n-\t\tdev_info(dev, \"VF %u is being configured in another context that will trigger a VFR, so there is no need to handle this message\\n\",\n-\t\t\t vf->vf_id);\n+\tmutex_lock(&vf->cfg_lock);\n+\n+\tif (!ice_vc_is_opcode_allowed(vf, v_opcode)) {\n+\t\tice_vc_send_msg_to_vf(vf, v_opcode,\n+\t\t\t\t VIRTCHNL_STATUS_ERR_NOT_SUPPORTED, NULL,\n+\t\t\t\t 0);\n+\t\tmutex_unlock(&vf->cfg_lock);\n \t\tice_put_vf(vf);\n \t\treturn;\n \t}\n", "prefixes": [ "net", "v2" ] }