Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp281687lqz; Fri, 29 Mar 2024 17:28:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4wjx0VkWPoNKMilTdvkegP0uHDDoeu5sWliUvD6/M83bzG2Pc1IDUX054K1p7fjdBP2RbWNu/LFEMC9dhofjdWpCuEQijMhAremkOIw== X-Google-Smtp-Source: AGHT+IEzCgfZZ2KKZKWb3GxPRfty1euA6MHnQLhG/MI8s1Rh55ihApZXxoVTHWDkrGciA9RF35Qe X-Received: by 2002:a05:622a:50e:b0:432:b42b:8f3e with SMTP id l14-20020a05622a050e00b00432b42b8f3emr3899515qtx.64.1711758512751; Fri, 29 Mar 2024 17:28:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711758512; cv=pass; d=google.com; s=arc-20160816; b=oU5U/po5zWOEIwOpTk82h212yzruBbLAUHBdcnwwDdnhjixoaJWWESSRDQDI9ptJ0R peUL0GShnDndxCLqINa8i2pv8JXzzlGotpWUHmshqC68y3xlGwkKsmtapwlrORY6cy8a sJ8SscuEYvzmjS2HzKWho9oYvbFDd/7WKrdyeTTxdF9V9GOPaNMl/0zL1jpJSTg4slgu DBaRJcZx4tEr9n1ZrJE2ovb4MzHr0l/8btYu2oihfhT8Qq2D/6Q6366UoP7DUgcLYQdW RM7UhB25wah7mFKmYzWZTwlyUORwrzVha/JX3AWN6G/wuYJyjRe8VzkXTBkS3ysahEIy C9EQ== ARC-Message-Signature: i=2; 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=NqfruJCIbrcd6HqJHQznDnafmURV4zGM9R79GsGO3yo=; fh=Xyn9Xj2gdyr2uCX+sXQ868jhMHETD8rbs01IV60LLJ8=; b=UWdkzwv9L92CCA+3H1WbS5yqFi+yLHWnFqz+aZ7UVkmsW3W+bcG8zZ+EsjESIfFswu i/KvNgvwfF90PLLaAny2vHDqm4QOs3xR6Ko34FSrNMqDpGOg68xJArA4ytfkNILYPqe+ MGDPoKM8ozJSscb4mVCgXbe9MricgzPExiVTPn7B/hRmvSb0cXLYzY74gs3TKnMWv3kp BkrNk0ZVa1W5NIEAalxh0s9TVnlxG2L3ctlPuaSwzsTI7ANgCdmqSaNsow7uCdyIb7ZV rzQ8nkHT01g2pdd4R/n2U0y1xENTAVYymIUFPGJC3sv+VZxhYrKz2u3P1nTsPjeC/3Pa 6rNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-125550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125550-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q8-20020a05622a04c800b004315f241a3esi4910251qtx.240.2024.03.29.17.28.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 17:28:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-125550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125550-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 79E4A1C2122A for ; Sat, 30 Mar 2024 00:28:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68D7A653; Sat, 30 Mar 2024 00:28:27 +0000 (UTC) Received: from mail115-118.sinamail.sina.com.cn (mail115-118.sinamail.sina.com.cn [218.30.115.118]) (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 66564181 for ; Sat, 30 Mar 2024 00:28:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.115.118 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711758506; cv=none; b=ZmvTXnbUVW8T1+K/wwAtRrZ0xldh9knAyVlFNNAuONl6OBlENJFIk4fOcDQ9hW/aRSSeWKLpPmz1w6QxSXo5Ueg6vrmWVBQ+nZH2NlAa20V+ZrYkPIvh6gq9sJOvsoEzHCQrMvaf2m4/DBaFYjmyK9bLeYNRJoKwWO9wL+eEDeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711758506; c=relaxed/simple; bh=ChKy3mAhdTmBWc2KahAhaGBKwWG+SUe+Bkx0ut5e3yI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pozQmA6nnH5FTkENolgxh8YIMo4DruFXUyBWFDJ0hbLamxaQe5h51D90pwQvem5K78iImlagSQAZTp91vikOCVc/shgLHvIFGgEsU7aCBYYkypSzQ1W1oXMSxJN2Ay9WY446I5DSHZWsamQe7vrQJm7suSVJ6zgoyJhHXSQ1ZVk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=218.30.115.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([113.118.66.4]) by sina.com (172.16.235.25) with ESMTP id 66075C7C0000023E; Sat, 30 Mar 2024 08:27:42 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 94883934210299 X-SMAIL-UIID: 645845FF51BA489B8BC8443E843AA375-20240330-082742-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [bpf?] possible deadlock in kvfree_call_rcu Date: Sat, 30 Mar 2024 08:27:32 +0800 Message-Id: <20240330002732.3029-1-hdanton@sina.com> In-Reply-To: <000000000000716bb60614acbf37@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Wed, 27 Mar 2024 16:27:19 -0700 > syzbot has found a reproducer for the following issue on: > > HEAD commit: 443574b03387 riscv, bpf: Fix kfunc parameters incompatibil.. > git tree: bpf > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16ca53c9180000 #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fe46a7dd189e --- x/kernel/rcu/tree.c +++ y/kernel/rcu/tree.c @@ -5149,6 +5149,8 @@ static void __init rcu_dump_rcu_node_tre struct workqueue_struct *rcu_gp_wq; +static DEFINE_PER_CPU(struct lock_class_key, krc_lock_key); + static void __init kfree_rcu_batch_init(void) { int cpu; @@ -5169,6 +5171,11 @@ static void __init kfree_rcu_batch_init( for_each_possible_cpu(cpu) { struct kfree_rcu_cpu *krcp = per_cpu_ptr(&krc, cpu); + struct lock_class_key *key = per_cpu_ptr(&krc_lock_key, cpu); + char name[32] = {0}; + + sprintf(name, "krc%d", cpu); + lockdep_set_class_and_name(&krcp->lock, key, name); for (i = 0; i < KFREE_N_BATCHES; i++) { INIT_RCU_WORK(&krcp->krw_arr[i].rcu_work, kfree_rcu_work); --