Received: by 10.192.165.156 with SMTP id m28csp31660imm; Tue, 10 Apr 2018 15:46:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx48iMktnnJS1FjfQjrVn/Q4iLFquvDwQyUP0ShkKeiop2rZrxGwcryQRyeGhuwckiMlNMNSA X-Received: by 2002:a17:902:a24:: with SMTP id 33-v6mr2367251plo.72.1523400408756; Tue, 10 Apr 2018 15:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523400408; cv=none; d=google.com; s=arc-20160816; b=IH80eCrkB6aFDwcHb5kVyxiFWCtm39gdkGDDNpN3VqzcOKwWmYVaZT/03J/5LUqbxd hcUdfxVePLZDeoLhtlpD1wiJEiyxDaw+8dJc8Hi6GrHQF/iYAm3vBLcOtElb2lgydQ0q eNASAlhqIXYMgRbUB3LgVfTemnBhabABRHObJRrbuAjKvJesdfTDFlUzViXEA/LBfQFN cLe57N/JxxqPN+nNQ5ppA0VlkJcieDgbqL+Me6GxG3SP6ybDG85B0KT0lAodxipiFhBB JHutOmdhB4g7EsnTe0MiNCzxsorxaJWvHvklvvnbIIXEDAcJO+VDrCNHg7vsV9AdY9ge fa1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=KyHYRUXmWQcZJFN9pyOhIH8KhlE6xu1xTw3IerqCYuI=; b=aBIPaxn0nYi7evKnKCOMNTR3sPeC69kDsLcT8GA2Y9ddHVjJYqTm+kGvBZH40LCauP PJ3lTY0LyozB4Y8hUtcSCLc2/IiUAYGieGOnRunl2CD59FaTh+4z6dismDSeqdGbej8N xFe30CYuWYCzHboCxMM2pNTZ6Ruy75v7JlVQQ+/zrh/OV7dlfRKEoCr6q6PikPCkP/Vj 3T+VG3zcj3aLvzUIcDlxTt6MZkX074QdmB9qVjrBFqsWuEyaKINE/rN7b7l2gOfNdY9m 01evQJU/5wR9ukGE3FlrHODxkBKPna3p2+/qtBcIqvPWxXnoYvt97J9jZnQOWh6vLcDo yWfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16-v6si3448401plp.621.2018.04.10.15.46.12; Tue, 10 Apr 2018 15:46:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756109AbeDJWkD (ORCPT + 99 others); Tue, 10 Apr 2018 18:40:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46266 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932680AbeDJWkB (ORCPT ); Tue, 10 Apr 2018 18:40:01 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1815BDEE; Tue, 10 Apr 2018 22:39:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+7f073540b1384a614e09@syzkaller.appspotmail.com, Jason Wang , "Michael S. Tsirkin" , "David S. Miller" Subject: [PATCH 4.14 137/138] vhost_net: add missing lock nesting notation Date: Wed, 11 Apr 2018 00:25:27 +0200 Message-Id: <20180410212918.165552577@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jason Wang [ Upstream commit aaa3149bbee9ba9b4e6f0bd6e3e7d191edeae942 ] We try to hold TX virtqueue mutex in vhost_net_rx_peek_head_len() after RX virtqueue mutex is held in handle_rx(). This requires an appropriate lock nesting notation to calm down deadlock detector. Fixes: 0308813724606 ("vhost_net: basic polling support") Reported-by: syzbot+7f073540b1384a614e09@syzkaller.appspotmail.com Signed-off-by: Jason Wang Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/vhost/net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -622,7 +622,7 @@ static int vhost_net_rx_peek_head_len(st if (!len && vq->busyloop_timeout) { /* Both tx vq and rx socket were polled here */ - mutex_lock(&vq->mutex); + mutex_lock_nested(&vq->mutex, 1); vhost_disable_notify(&net->dev, vq); preempt_disable(); @@ -755,7 +755,7 @@ static void handle_rx(struct vhost_net * struct iov_iter fixup; __virtio16 num_buffers; - mutex_lock(&vq->mutex); + mutex_lock_nested(&vq->mutex, 0); sock = vq->private_data; if (!sock) goto out;