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 161C745D38; Mon, 18 Nov 2024 17:24:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CA3C40677; Mon, 18 Nov 2024 17:24:37 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 5C90840677 for ; Mon, 18 Nov 2024 17:24:36 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-20cdda5cfb6so29825875ad.3 for ; Mon, 18 Nov 2024 08:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731947075; x=1732551875; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=SHRnxI2QK0YpXEB8PtLvis0Eo3BwChk5unWPmA9WX8w=; b=0EKrARj/74J0aaQAvHqXLLJRT4c6JHSQT8PVhOxy1V4xoC0fi/nxZd7RfGRAH9jt/k dBimhBSgU72NiGo5x1caUS+ZwD2DrvpgEdfnCa4vwkTmwtcvh9bwAuWLObiN3YlEKSWS i/XBPXYvc3WgqqUbLSqm+7Rfy5+kvkJBkDAY68FfEmmltX28Tnf8o6GR91PW/9Dr4mSA eIvEyuc94hL58h9eM/Knw2C8typxHp4cMBw85h+orqvu19J/3O4vXWkuMSfQwUZY8Z55 4fAfA7jfnmbN1nqyPzrC1pHKnPc8hybuuzsJ/XjdJjaqNGOfUUcg0YMhoqS3cMZUq+0H gAEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731947075; x=1732551875; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SHRnxI2QK0YpXEB8PtLvis0Eo3BwChk5unWPmA9WX8w=; b=xLegh7Fz0+Pk1o2b21bH92+Up9zhwV4nnbrDTTHRYxnLQ0lzxWw43NWHCO6a8qlMB6 3T9cZkPRuaENx0YHt9cpSK3461el9Wvw4AnnPujSiFlY1MHC1IaZ1Fou8cWxqqmvxMKC /PO31Hu3DiF5FGVvdqP1KBBPCFHC6qzDxAC061A9U6ytIawNq54uNUH1CUZOAsWd/uD3 EwvuOuAkAz7rbrsxyBFfD01ATHjwkRcdlbo3CjswO1XOTrDZRNbe7fuNb9JjyxvYiRBZ 0M+QLmISvnN3ywkG4ZWyZsh+vs0nr2PtKEvsxbDPuacDBmHGm0r7X8x9p7sjjDws31om 0RxQ== X-Gm-Message-State: AOJu0YyudxDVMvF78ApZ2eIdzOAFODY6Rrs7TZbYIYIYWLDZvZR6otTb MgOJfE5MJemP9sESKUTrz1cQvo/tdisikB8iLgqeMzN8jLcD7AEuZAcfq1FI6QJ2nauTaNSFX15 + X-Google-Smtp-Source: AGHT+IF4n+3ly1IogJihuKFBfWcwH047Q8shXzuC49GS98vKSi5aLfRbFGpJ2CiMQ/T86J15PsxP5w== X-Received: by 2002:a17:903:1245:b0:20b:c287:202d with SMTP id d9443c01a7336-211d0edbf62mr155679015ad.55.1731947075236; Mon, 18 Nov 2024 08:24:35 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724771e21bfsm6365696b3a.162.2024.11.18.08.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 08:24:34 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , david.marchand@redhat.com, stable@dpdk.org, Maxime Coquelin , Chenbo Xia , Eelco Chaudron Subject: [PATCH] vhost: fix read vs write lock mismatch Date: Mon, 18 Nov 2024 08:24:24 -0800 Message-ID: <20241118162424.9038-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org If lock is acquired for write, it must be released for write or a deadlock is likely. Bugzilla ID: 1582 Fixes: 9fc93a1e2320 ("vhost: fix virtqueue access check in datapath") Cc: david.marchand@redhat.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- lib/vhost/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index 298a5dae74..d764d4bc6a 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -2538,7 +2538,7 @@ virtio_dev_rx_async_submit(struct virtio_net *dev, struct vhost_virtqueue *vq, if (unlikely(!vq->access_ok)) { vhost_user_iotlb_rd_unlock(vq); - rte_rwlock_read_unlock(&vq->access_lock); + rte_rwlock_write_unlock(&vq->access_lock); virtio_dev_vring_translate(dev, vq); goto out_no_unlock; -- 2.45.2