Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp765045lqh; Thu, 28 Mar 2024 16:13:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjolrG2H28E36koYJHsuxonDMlQ451I2ele9Rq8Xb2DiSD6k3C5HFZoLvn3BRPrmcPMXyr5xM40eBI1PP3snYccWaCpTf8jJ2pTMjzYw== X-Google-Smtp-Source: AGHT+IFymQjWLxBV+a0bIzA5HNn/LUZov2bcnuo3O973wFxygEuyxI4TLgSKGGEgh6PbNW4pDwe3 X-Received: by 2002:a50:bb44:0:b0:567:23a2:5b1e with SMTP id y62-20020a50bb44000000b0056723a25b1emr417105ede.23.1711667607832; Thu, 28 Mar 2024 16:13:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711667607; cv=pass; d=google.com; s=arc-20160816; b=TzuWeIUiJG9Vbe/8uGAFCqgD4BCCFN6ZFvJzvu1BEVLPy/eyajGHij4ttlXgSUSnUU Q8ntqiyU6djsRWac+Q/cvaDHej9nXOmqua2mwQ/i0kKzPt3nTcs/eOutVrjv2GDIQduz I7WCYGPWUirB6XYOrmXS+3meJvNn5CEy5njBfm6JIfqxb/xnCv7J5rcQEp1ytQa/8xt8 AgTDvB7+rlxDmss5sglJjfZRbMVFZgqsteSeGHbHcnrmhHwU7Vvssc5MhlIcJbSuli0Z G4l5Y0RIenKZD2Ts4kbD/8BA/JyA1qn5Cisdrc/vgQOLJicem2OYSluv1uvN/cqP5N2t GA6A== 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=4K/Q2a0wFP711cayVOYEDI+sf+oTO62jCgR41WQ0yWA=; fh=Xyn9Xj2gdyr2uCX+sXQ868jhMHETD8rbs01IV60LLJ8=; b=GlFRU2O3D/Q0Ms0BnBD0PcECYJSmZ+r/4f8ouiaGNJzjFxMnK5QjJS8zaKsh4G3KSo UNsUbk1ikf4Z9z3xgcl8XPIjd51D7cr9mJ1o6JUQvIgwGLsiyPlgJ+S0ZOLYqYQAmwYM A96RqwpletY0b0M2CGtc1m4wfMQEV9SmUaJsh9K6tSPZ89jkkEHHIed0Gx7TzK2lbQ3P rvlhx89DwdQ2wIR75WzOoEaDnvpnGN8R5h8x0/tneG3tAHCHGUtHprtME3c3lo9ES9w9 X3ef8BOiresp1CXKbAPuMQV9U5poY6wzczuh7MXfJuKNwLo3XvOJrnj489//UGuhwQag 5jkw==; 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-123808-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123808-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n19-20020a509353000000b0056c441b2d68si1170625eda.160.2024.03.28.16.13.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 16:13:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123808-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-123808-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123808-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3F9D01F24B2B for ; Thu, 28 Mar 2024 23:13:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F0EC5F873; Thu, 28 Mar 2024 23:13:22 +0000 (UTC) Received: from mail115-63.sinamail.sina.com.cn (mail115-63.sinamail.sina.com.cn [218.30.115.63]) (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 30EBE171AB for ; Thu, 28 Mar 2024 23:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.115.63 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711667601; cv=none; b=AaT9izK4weZdXx7COPXePpwU38no88dJJf/gD2myrKul3oQ1EIvonsB+BgJm97tExlKyMKZVbQqsqLr3q/rP0desDAs/IWvZq+fzeyi51j52i+HuYKcxxrLPNY6ZDEv9yn3bas3JGnIs6JJ8/vclkulOPiobzIybI+kH5m5UXOQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711667601; c=relaxed/simple; bh=IHJcLm3oNfQxjGQAifqBLrvI1ODFdqL/UXNWzIpk5Us=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u0NJfVidzcH/IXVPp+sbFVdGT32SQ8WdIZeqZuJseKisjr3ocuDxEQqBhbiJu7jnvjSop/Snd/Ov5HZSmWl91HxJtUvcV6HMiGJKoDvidqs5r31NurBBiHJZ/wJzAOoLaY5W3cn5tK3LyjyuETNekKYHL2c9bn6LaMq0ypbdkv0= 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.63 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.88.48.240]) by sina.com (10.75.12.45) with ESMTP id 6605F84300005A3F; Thu, 29 Mar 2024 07:07:50 +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: 26469631457776 X-SMAIL-UIID: 9F53B0D3199D457282B4296FDB24A34C-20240329-070750-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: Fri, 29 Mar 2024 07:07:38 +0800 Message-Id: <20240328230738.2910-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 master --- 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); --