Received: by 10.223.185.116 with SMTP id b49csp3928377wrg; Mon, 19 Feb 2018 08:15:58 -0800 (PST) X-Google-Smtp-Source: AH8x224T1PfaPRHchJ1oKNUaIn9rNVFmmwA9l4TG9oNXsw2LRNAY+k1LcwKNEjURgqj8kt+VQptJ X-Received: by 10.101.80.132 with SMTP id r4mr5913653pgp.185.1519056958664; Mon, 19 Feb 2018 08:15:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519056958; cv=none; d=google.com; s=arc-20160816; b=Z8U54VSd0CSpcRIh1fZTQpQPmREFDEAY83Zs7+ZiYNPLWwW/ehLGnpEgXiCeTWwnwJ kFJj91NwZ9CnuJ7q5wBDzRTmltitoqqVdFJoiTYnjbCYn59Gn6ZbnDCEEkPhSfgQ61D4 BFICwEe+0PQfKF3YQDDxPoNSxmefH4VpkBtUQ2HjWe7aLFmEm+suMELqdstK/fXejtQ+ C2yB0aM9/HHLj3m076hn4PGGwUwBQmh8jh+OTR0XHGjQu/qj2tzJN6yaarWirlKnnBAe hbgAhLEFlIRaDMoprg1TbEkV63s/ONd0Jc93Nlg8YSj8CykUTAa4T7npaMREKqpv8gVz 8QPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=Do6h4WbesOcihlaDHx2Xn+wt/hhNXyX3wGYMNml9wVM=; b=Qs71lCuJos56V7tyRyhz//gcQ8R1SvllPzA3Gv0MhVyUOiR6XE9/StGOp14Q6TXJSG 20UK2vd6jikFSx9kSw/4kEYmeZe1/a0OfztrctPsY7rvlvePOqtsSlfb8wNNCPBRMHU1 9XLfPsB/W+a5UihpK4aWsaCFlp76yDY875Uvr2o70O9P1yRMGGadDyVtpScbPisWTmxK dz4hJCK11RpqzSmtYqkbAjlA7S8GtIEt8avNImYk3WW6zgxM0RWsQV4w/QassIsT9BFK u6k1GyFSm65efjoWSfXy3HdXddmYeSBHBkH/6wa/KGGqDg6B2TZL7jztatq9e0IlJS8Y 1MoQ== 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 3-v6si5495717plv.604.2018.02.19.08.15.44; Mon, 19 Feb 2018 08:15:58 -0800 (PST) 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 S1753067AbeBSQPD (ORCPT + 99 others); Mon, 19 Feb 2018 11:15:03 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:32768 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752690AbeBSQPC (ORCPT ); Mon, 19 Feb 2018 11:15:02 -0500 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 15D3713CD7FA0; Mon, 19 Feb 2018 08:15:01 -0800 (PST) Date: Mon, 19 Feb 2018 11:15:00 -0500 (EST) Message-Id: <20180219.111500.677838714163586859.davem@davemloft.net> To: khoroshilov@ispras.ru Cc: jasowang@redhat.com, edumazet@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: Re: [PATCH] tun: fix mismatch in mutex lock-unlock in tun_get_user() From: David Miller In-Reply-To: <1518819115-13507-1-git-send-email-khoroshilov@ispras.ru> References: <1518819115-13507-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 19 Feb 2018 08:15:01 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexey Khoroshilov Date: Sat, 17 Feb 2018 01:11:55 +0300 > There is a single error path where tfile->napi_mutex is left unlocked. > It can lead to a deadlock. > > Found by Linux Driver Verification project (linuxtesting.org). > > Signed-off-by: Alexey Khoroshilov As Eric explained, tun_napi_frags_enabled() (and therefore 'frags') will never be true for TUN devices, which is the type handled by this code path.