Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp116760lqh; Wed, 27 Mar 2024 17:14:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDteWrWMysmGo6uaFlskJ9QIHaywRPxFtTOXnqKd3cL74YlINc5y9EPmY3OgCpLMZV8rV4/E2kBrNXTnd2QQof/b6s+hIenqJSRQuzQw== X-Google-Smtp-Source: AGHT+IE3TToHlWHrHAYyed6mCUbSpIq71c3/HtIdbHpMGCbgsLtuiuX/vzIqbi0ZI+J3EUg1mpsO X-Received: by 2002:a05:6a00:9296:b0:6e8:f66f:6b33 with SMTP id jw22-20020a056a00929600b006e8f66f6b33mr1729292pfb.4.1711584872389; Wed, 27 Mar 2024 17:14:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711584872; cv=pass; d=google.com; s=arc-20160816; b=Fwnt/2NFM2qe/r9zei8m9WdT/p2/j1rUCfUPt3G8m9RTsp/cdadeRacfQ7LQ5AMEqd 8wfn2SzqhJZKB2zsqn6sLX4NDWf/W/8AxpPh/Xgs1YJxpdtQVBrTq+c/CB5m3FOLmSnf EFrUTHFjdS/tnpELDs44ZhLh716Ue+kYYPcBG974Qb5W+nf+DD1mZDuwQtGUsJtO7dW3 z/VUV+BzY6XaPvSqjHBzOpzxH5YnPonD2GisFVnm0Tue+U+Bxn/UlnKaDEoABPuqXPbd 0MhFhOWQbTIM5Et+sfvjJhTO2UdbpzRw0nJhMj0v8ilBWg5OlKmvwuv1T/F6KilLx7qS rrpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=VYP5DWUrKLTTwT+sg5pB8c1G5q9nAtl+vodYL3+O2EI=; fh=azCX03h4jA9AW3gnR3Ve2BlsMSTHqx/EmDefY+vv2go=; b=OuWLwrLNFHEJW3jP5poPBN1ORMpyUkRZGI49RETMbvqn42vSv/vunJK6OnbGFOK5k2 bT38o6cAGjRwB+5g5LESBy7ixJ8efpOYTbg7d/3IaaNozmWiGBl1tb3xg2i9MtsUGhW0 OArrYTkQ4sc16vep2Bdl2Ic+TLpzDOWlY6UH6zicLRtchqCR70nq18k2nEOTB7yyw77e JvP/CkTorPJ9bhommQSHdAZVcdT6f8jDOUGNpQRNXuzFLGRplI6Wb5O07wDISrLROn/a N+YYqB8cWKg5GR8TOt+g7TrENInxXN54tBULoAd9F8azqa9DS5yPBd+FQxgxru0rS75d tMrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cmqnBj0N; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-122205-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122205-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id jo20-20020a056a00909400b006e68839a4easi264191pfb.391.2024.03.27.17.14.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 17:14:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122205-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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cmqnBj0N; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-122205-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122205-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 1AF5FB22CA3 for ; Thu, 28 Mar 2024 00:13:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 795F563B9; Thu, 28 Mar 2024 00:13:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cmqnBj0N" Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B823193; Thu, 28 Mar 2024 00:13:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711584791; cv=none; b=XHFxAf14J8XHUq8MMshCY5vrzrZ1FhblrNu+QZ/SRFyce9UXchS6QoH34SlrmU9Ueu46/18HSqFEqCCPyZG2LxJp0ccIwea27BTP44iU2FTxsq3vb6wl/KfBAmXHREPeB2+F6oyH7xMmtUwkToj6xYZeOew4sqnvyXvft66FaGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711584791; c=relaxed/simple; bh=DyNxlN+eZeRw9Yeq75xoGqiNrNHyIXDie/JPcFLU8ow=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jj8hYvJG67Zgvtwx7fBK/sQ7SYHiDzfHBUK4Bzh0YhPMcD79a+wNYa1wRoJoytARQkvzNiCw3/PjStEpaVilwzInAssPregB5uak2PfuKPshZbmjVpaaC7saFqjtC7QbAF6hjTEun4Ue0s0uzAMEOiScwkK7k2X9B/UPdUcAgQk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cmqnBj0N; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-33ed6078884so827404f8f.1; Wed, 27 Mar 2024 17:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711584788; x=1712189588; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VYP5DWUrKLTTwT+sg5pB8c1G5q9nAtl+vodYL3+O2EI=; b=cmqnBj0NtnetiBdVXzBBLpkphzD6TtNqxyz3cOIx02WqexFaboj/SWLjwmLa+o1UYg HbrierlIDh7zUcs7BorUEi359Qk9YXM0nUuH4VJxEdF1/m6pMMV4vtlOGGfVjs/3MN0x vO8nwud/9kVaKyW1buSFkjiqi3m+8UB3eTtKCFQ8WwnPDY4EuxOUapQOwspCTOqe323Y fisF68gBXRaKMlh0O+cCTU/SXUPxaC8Te3PNciVp5FJiKd+zYgfWmGO8i/kpFlShsHNE 3xZ4kixUcGPtJrksv5Qcc1HDcIrTHgkDUpHm2U/4XU/Xcm6GSuLNxkT1gdKVFKfUzJP8 YbEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711584788; x=1712189588; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VYP5DWUrKLTTwT+sg5pB8c1G5q9nAtl+vodYL3+O2EI=; b=ELrWIQQgmehRERb4i148SGUwnuoQCyfRC/4W/91RBRYDCxDGbjNWglcezF3X25Nq7q TeSKw/w0NzA//OP5aXEXXEHXtDwlbJpz12VdY1f4f3gs+ETR6d7kTY5lsGnFFG18lBG6 0q55FQQ6PoFyiAgDCijeZ9rKJ5a1gF+i9swxtPCoLstGxExmd1DSylIDjMVMTP+8Uonb pjigfmaniRwmYySpBP0Vcb+U4G4FXNZh4WY/q9THnHRH/3DEC+VUiQO1JDDdezufKePD WAbWtjB+1I9ItcOk+EpY/lzLrgfs/9BCJK94FIbv68tlGxFvhbxASj8kpZWIfQ1ujvP0 UOcg== X-Forwarded-Encrypted: i=1; AJvYcCXMSh6tYiRpXoav+IF6UwtBOzapi4SJEFmEa9r/iuPec9cXuFn48O6LFWZORrhEAGq+aPX/2VXxSi7k4lZ4pEXT38+p3OcDkEL46V12XBno49WzEWbIFEOjT8lAjZRWVUb297CqW5wlBNCyJvsGlPzRjR10X6wK X-Gm-Message-State: AOJu0YxQuecK0BwnZ/Mlxb9pCru8Nbw41K43Hqy+0mKsFMC12ndOczDP klrSk9Di7g3xvCkxT6zkAz7XY2skPQvYcQg1tsiVkpAtToTAO63MhtS/wDp34i8JgtGLnt+Nqag BxSVgSg2Rq3pVzHc5LFDunCcfATguOpMc X-Received: by 2002:a5d:680e:0:b0:33e:9763:75e1 with SMTP id w14-20020a5d680e000000b0033e976375e1mr538773wru.33.1711584788213; Wed, 27 Mar 2024 17:13:08 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <000000000000f2f0c0061494e610@google.com> <6fd11cc9-9376-4742-8f54-1d2988622a6d@paulmck-laptop> <4dc396d9-b57c-4ccf-bbef-887d5a42ab66@paulmck-laptop> In-Reply-To: <4dc396d9-b57c-4ccf-bbef-887d5a42ab66@paulmck-laptop> From: Alexei Starovoitov Date: Wed, 27 Mar 2024 17:12:57 -0700 Message-ID: Subject: Re: false positive deadlock? Was: [syzbot] [bpf?] possible deadlock in kvfree_call_rcu To: "Paul E. McKenney" Cc: syzbot , Andrii Nakryiko , Alexei Starovoitov , bpf , Daniel Borkmann , Eddy Z , Hao Luo , John Fastabend , Jiri Olsa , KP Singh , LKML , Martin KaFai Lau , Stanislav Fomichev , Song Liu , syzkaller-bugs , Yonghong Song , Uladzislau Rezki , rcu@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 26, 2024 at 10:04=E2=80=AFPM Paul E. McKenney wrote: > > On Tue, Mar 26, 2024 at 09:37:43PM -0700, Paul E. McKenney wrote: > > On Tue, Mar 26, 2024 at 12:53:35PM -0700, Alexei Starovoitov wrote: > > > Hi Paul, > > > > > > syzbot found an interesting false positive deadlock. > > > See below. > > > My understanding is the following: > > > > > > cpu 2: > > > grabs timer_base lock > > > spins on bpf_lpm lock > > > > > > cpu 1: > > > grab rcu krcp lock > > > spins on timer_base lock > > > > > > cpu 0: > > > grab bpf_lpm lock > > > spins on rcu krcp lock > > > > > > bpf_lpm lock can be the same. > > > timer_base lock can also be the same due to timer migration. > > > > > > but rcu krcp lock is always per-cpu, so it cannot be the same lock. > > > Hence it's a false positive, but still interesting. > > > > > > I don't think rcu can tell lockdep that these are different locks. > > > > It might be possible. I will play with this tomorrow, modeling after > > the use of lockdep_set_class_and_name() in rcu_init_one(). I am a bit > > concerned about systems with thousands of CPUs, but it just might be OK= . > > Except that each of the resulting separate locks would eventually be > classified as participating in the same type of potential deadlock cycle.= :-( That sounds like we have to address it on bpf side, since we're being spammed with syzbot reports of various forms and all of them are about this false positive.