Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3853173pxb; Mon, 1 Mar 2021 23:34:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCWpGGYTcS/TyQoJ1Fxw5GlOVGjoCscINZeNneGqDKddvVbIkEPyQFDJVZh7QoxqFVlYQW X-Received: by 2002:a05:6402:3122:: with SMTP id dd2mr19381152edb.253.1614670451519; Mon, 01 Mar 2021 23:34:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614670451; cv=none; d=google.com; s=arc-20160816; b=bhihHXAXBXfz/bzPgkyZHhszGCMpVQIE/AaWPT/uIH6Pg3JtnHrhQC9tK/hTMwP/SG WZmpJrWaTecAqv1P908Xc3whxs0r9+VuihrjTY5d8IZl6m0iGBCq3Q3UpGrBOOlYfMy2 lWycoZLvfercz3mhhqRdga2tdeFyFM7+/qyHfTvmFTclZoIaUhIq7Jk4Wv3EwspG9iUq 1oqROVD6PEJGbYGnaRIm4QpzslgB24IosQjYq/gE8DbPtBWwD19sAfB3nDgyyudUCiB5 j7X66gwpCFf/TxKqohIAX2vhwXXQEF790oQLwNMUdA6lJA2ETLKp4mpPLwyv0fYRCsSS MfCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=n+GE5NPMwKgKnMwVG9w2fpfUt2oveESr75xiTGvJNq8=; b=O/vaw7Q21Ojpoc0hzFfzJzt5D8vRP0RGidgaCWiwI/BEa1f8PsCK+k0zPoa3ingJyo zVY/BfXca6L0Ejtzv3hJF360fU6yimf3kJntGAd1bBUqJlyA+Zq7rRY2v0PV83QFgyIp emoL47fO9Tw3FsOA22jBv9X0xdEpxCris5IPw6JtX9sIoB91QcsktBTGVAJ911JtSy+Q dd2Ze4W+fzyNfJCJThF4w9eGrbci3KFK/KbjdbdzXQ1XYy2XioST7BvNMJEp19/K7ZqB Ehkx1kw7iFFthlqzJi3P8xIdX07G9xs//P/y4cO8pAlfc/7ICLBtu0LT4OFQ4OJwK9WC W+DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="dQ0/WQm7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k18si8009483eja.602.2021.03.01.23.33.45; Mon, 01 Mar 2021 23:34:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="dQ0/WQm7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377802AbhCBAsw (ORCPT + 99 others); Mon, 1 Mar 2021 19:48:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:55414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240467AbhCASrq (ORCPT ); Mon, 1 Mar 2021 13:47:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 79B3064EE6; Mon, 1 Mar 2021 17:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618800; bh=Zx9LDLiJDNi9Yp+SxQtDzp5TmEwpvydW9I5sVx36m6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dQ0/WQm78xw6Lz+7hwpJjvbtheOnbBLQPMnmm4lt8mxJM/tWD6PGU3oRvy7PHOYrl 7IraSDeVgx7f1gbxH65GC8l0NfIxzlij7KnJ/xswqPByU0CPDjRzuER10Rxb3QSitL xi6zN5MC7n7clTvRjY9d4IvTnBedIzbtVed+hRp4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Vyukov , "Peter Zijlstra (Intel)" , Waiman Long , Sasha Levin Subject: [PATCH 5.10 221/663] locking/lockdep: Avoid unmatched unlock Date: Mon, 1 Mar 2021 17:07:49 +0100 Message-Id: <20210301161152.730348458@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra [ Upstream commit 7f82e631d236cafd28518b998c6d4d8dc2ef68f6 ] Commit f6f48e180404 ("lockdep: Teach lockdep about "USED" <- "IN-NMI" inversions") overlooked that print_usage_bug() releases the graph_lock and called it without the graph lock held. Fixes: f6f48e180404 ("lockdep: Teach lockdep about "USED" <- "IN-NMI" inversions") Reported-by: Dmitry Vyukov Signed-off-by: Peter Zijlstra (Intel) Acked-by: Waiman Long Link: https://lkml.kernel.org/r/YBfkuyIfB1+VRxXP@hirez.programming.kicks-ass.net Signed-off-by: Sasha Levin --- kernel/locking/lockdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index bdaf4829098c0..780012eb2f3fe 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -3707,7 +3707,7 @@ static void print_usage_bug(struct task_struct *curr, struct held_lock *this, enum lock_usage_bit prev_bit, enum lock_usage_bit new_bit) { - if (!debug_locks_off_graph_unlock() || debug_locks_silent) + if (!debug_locks_off() || debug_locks_silent) return; pr_warn("\n"); @@ -3748,6 +3748,7 @@ valid_state(struct task_struct *curr, struct held_lock *this, enum lock_usage_bit new_bit, enum lock_usage_bit bad_bit) { if (unlikely(hlock_class(this)->usage_mask & (1 << bad_bit))) { + graph_unlock(); print_usage_bug(curr, this, bad_bit, new_bit); return 0; } -- 2.27.0