Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8128486rdb; Thu, 4 Jan 2024 22:06:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGRrYBzFDI/Tx3+qtMOEIyVqpiHG52InDxSNmpx0Skg8EAUYsccRi2nu7MAnFkZAwATbKu X-Received: by 2002:a05:6808:1890:b0:3bb:7549:8d89 with SMTP id bi16-20020a056808189000b003bb75498d89mr1898720oib.25.1704434795440; Thu, 04 Jan 2024 22:06:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704434795; cv=none; d=google.com; s=arc-20160816; b=Qy9UrRwYhE7k32L8gKaqm+mGIIpOhfNx6xFW+19JkH9P7z/hCeYu9ujuvcMO3MybIy wai/tCBfsb04BihvLvncmdbzEnpG4+3XUrhqudvhzERxgY6ZssijAXVbofQDYuqhKyHo uKPKAU/IYKhcUsiQgAEWEkSXWX0rHLGuGPCUHW/uGZxyXcZ1dOC0KPSkDVCDX2JZTDKK h359ZFd+6NiTqiHl861q5az3AUGYQXz2+xvp+ZKjpd6wOBJhkDHqoqtj7dC1OTSQ8928 d4/fxoAM7ykdlwwGJS/WciBDncj9tbhWJvHNcoxanCQfMJ26dh4qrLHkyiA9dzmMieU1 PPIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=WdkFKCRbyK0g3vjxPFtUnW8TRCKNxZu/fajrS3Vsaq8=; fh=6TEuBn3xHBmm9CO09z8Oulz2ZYn5AJtkDIzfzYoQFK0=; b=MeLWyLlZciSmJIFH/6JyaWbzyN4yQy4iiwSbb6NcodrFSbaBleUEw7uL13BJlEK2rX LcmD30miENrfrPqFs5EVZq/afWxYblE+S2sFoTczQ0YYHahJ2kkidHwkNuqKj0ML4UWR pjMR/rvmzRwi2ne3GQ09ihxr400gj8FIpJyO0xEq3AUm9DJLfcjKEvj0W+vTClH8CJXS 8WVQ+f80hcqRODX5TfuRtoVR3g4uRnn3pRq+KOUo0Fm58Nsti3NJKbZUqe+WvdCow8rh B4bojfg/9YOJOoobtd5EsqRiN1WKViXXBo9HALDWXy0AENx75M+GmGbg6ihJ2p9VkDUI LW2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-17498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17498-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s24-20020a63f058000000b005cdff0f725bsi762015pgj.80.2024.01.04.22.06.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 22:06:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-17498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17498-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5C118B232DD for ; Fri, 5 Jan 2024 06:06:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1A315CBE; Fri, 5 Jan 2024 06:06:22 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09D775662 for ; Fri, 5 Jan 2024 06:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 40565A0p056912; Fri, 5 Jan 2024 14:05:10 +0800 (+08) (envelope-from Xuewen.Yan@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4T5t6m0M9xz2NZjcg; Fri, 5 Jan 2024 13:58:24 +0800 (CST) Received: from BJ10918NBW01.spreadtrum.com (10.0.73.73) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 5 Jan 2024 14:05:07 +0800 From: Xuewen Yan To: , , , CC: , , , Subject: [PATCH v2] lockdep: Add missing graph_unlock in check_prev_add Date: Fri, 5 Jan 2024 14:04:56 +0800 Message-ID: <20240105060456.15331-1-xuewen.yan@unisoc.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL:SHSQR01.spreadtrum.com 40565A0p056912 The check_prev_add() is held graph_lock, and it should unlock the graph_lock before return 0. But there is one condition where it will return 0 without unlock, that is: /* is not found in ::locks_before */ return 0; So add graph_unlock before return 0. Fixes: 3454a36d6a39 ("lockdep: Introduce lock_list::dep") Signed-off-by: Xuewen Yan Signed-off-by: Zhiguo Niu --- Change in V2: -move the graph_unlock to check_prev_add from validate_chain(Boqun) -Add fix tag --- --- kernel/locking/lockdep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 151bd3de5936..c8602a251bec 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -3178,6 +3178,7 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev, } /* is not found in ::locks_before */ + graph_unlock(); return 0; } } -- 2.25.1