From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) (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 332B627A926; Thu, 24 Apr 2025 12:44:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.144 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745498681; cv=none; b=DD4cL124tRS/KYv4JjFE2RgEXxhtG2lnYibO2kCKKSnbH58dbj50anBvAI1BKQRJlXeWnsG92KuL02kK3N9GGYL4DeWcPdphjBwqY1fiVy74pfvKkKnhEhSPiCNEIDG+WB3l15wOMb7j1elIWMNq7THEleZC6qgXFzo8p0wVNCs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745498681; c=relaxed/simple; bh=7Ltb0P0T/p13f9Ik10z0acW2tEdNURIaj8Y/bKnt3lU=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=UG4W46NMyCOuuH2ae7xRQKQjTlgoINXD+7wdTb+93ErFIJ3cHcCECoJI/jS/jvVyZ7qcfGB6Uwxf3ZG5WEpM5tlAbh0IsIzfdC2Rq/bXmg52837DpIYjy34beZL9UK8Fqm2CFKr1AIEeEEQe7tk7n7vB5w9EppCobd4ORbamlOA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=readahead.eu; spf=pass smtp.mailfrom=readahead.eu; dkim=pass (2048-bit key) header.d=readahead.eu header.i=@readahead.eu header.b=gjI6fAtm; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=hZvVtmnh; arc=none smtp.client-ip=202.12.124.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=readahead.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=readahead.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=readahead.eu header.i=@readahead.eu header.b="gjI6fAtm"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="hZvVtmnh" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 7D62A1140230; Thu, 24 Apr 2025 08:44:35 -0400 (EDT) Received: from phl-imap-08 ([10.202.2.84]) by phl-compute-02.internal (MEProxy); Thu, 24 Apr 2025 08:44:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=readahead.eu; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1745498675; x=1745585075; bh=P6aDXOzwfsUnkNloFebsWwC3WTiLNzsId1SEYLxZLUM=; b= gjI6fAtmShaUzCLuZWKm+0H9DwH3BEsgke5uu8sRtB+X1KmfJo4qupEP+vIMcw25 /nnx1Ziq7pK9O3OxzFebBTgy+ZUESapjWFRS1E0vSyMlPFvv4npwJL3iP4K8aXPX xcgcwbQZO85G1KsH4ejPjGY9bMx3GWthWLOJP1v+fDQdtJy3WPUQ6oO9mKOZRPJy nwlQtYyFvdFNR97WMCJcGCRtl0ioF4RG/btIUrqaoYHqqRVz0SS8mfTd3bpCknUA HvH5P1TZzLBuyzC4qCN3S4xhm5NQ2Yd/wdRetJ/D0dBix0B6vK2JD0AEdTGNp0gp HfYMF2azwdmFDVAVbhXcQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1745498675; x= 1745585075; bh=P6aDXOzwfsUnkNloFebsWwC3WTiLNzsId1SEYLxZLUM=; b=h ZvVtmnhAKsf+lJgCFQKecmp/PsIEzk7Hssrx7G3itJgyN91f6CZwOJB0BWcAQra7 6TSLhvtx2dIypSu8lEBHKxDzb6OUfJP2ZkrjDAqTe6aRbimJyNHTleTy1PL69eA4 Rx+WtVaQNO0Xuk2bfAbirZh2iQpNwoL1yOQ7PyLn9vDkSSmCBUVD1uJQTdYURIUq 5kvCvx7BNoqSEEtGv3D3cB7Y06tmkmLv1Z/HBtSt0aOXBRSbffx/v3sGzXaBjnGH bw/D+dTGfVRzwrXj526OIAzPCS3OH5KVWMs4UsNoTwGTJckwuW0lbydE+5OYh/c8 pzsEWO3PvIZnP7SsjLeXQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvgeelhedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvfevkfgjfhfutgfgsehtjeertder tddtnecuhfhrohhmpedfffgrvhhiugcutfhhvghinhhssggvrhhgfdcuoegurghvihguse hrvggruggrhhgvrggurdgvuheqnecuggftrfgrthhtvghrnhepueekteduueejkeehheel vdefleeivdeugfekvdfffefgkeefuedvtdfftddvveeknecuffhomhgrihhnpehkvghrnh gvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegurghvihgusehrvggruggrhhgvrggurdgvuhdpnhgspghrtghpthhtohepudejpd hmohguvgepshhmthhpohhuthdprhgtphhtthhopehkuhhnihihuhesrghmrgiiohhnrdgt ohhmpdhrtghpthhtohepuggrvhgvmhesuggrvhgvmhhlohhfthdrnhgvthdprhgtphhtth hopegslhhutggrseguvggsihgrnhdrohhrghdprhgtphhtthhopegurggrnhdrjhdruggv mhgvhigvrhesghhmrghilhdrtghomhdprhgtphhtthhopegvughumhgriigvthesghhooh hglhgvrdgtohhmpdhrtghpthhtohepsghrrghunhgvrheskhgvrhhnvghlrdhorhhgpdhr tghpthhtohephhhorhhmsheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepkhhusggrse hkvghrnhgvlhdrohhrghdprhgtphhtthhopegrlhgvgigrnhguvghrsehmihhhrghlihgt hihnrdgtohhm X-ME-Proxy: Feedback-ID: id2994666:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 33FB418A006E; Thu, 24 Apr 2025 08:44:34 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: Ta1cb5089883f0698 Date: Thu, 24 Apr 2025 14:44:13 +0200 From: "David Rheinsberg" To: "Christian Brauner" , "Oleg Nesterov" , "Kuniyuki Iwashima" , "David S. Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , "Simon Horman" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, "Jan Kara" , "Alexander Mikhalitsyn" , "Luca Boccassi" , "Lennart Poettering" , "Daan De Meyer" , "Mike Yuan" Message-Id: In-Reply-To: <20250424-work-pidfs-net-v1-2-0dc97227d854@kernel.org> References: <20250424-work-pidfs-net-v1-0-0dc97227d854@kernel.org> <20250424-work-pidfs-net-v1-2-0dc97227d854@kernel.org> Subject: Re: [PATCH RFC 2/4] net, pidfs: prepare for handing out pidfds for reaped sk->sk_peer_pid Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi On Thu, Apr 24, 2025, at 2:24 PM, Christian Brauner wrote: [...] > Link: > https://lore.kernel.org/lkml/20230807085203.819772-1-david@readahead.eu > [1] > Signed-off-by: Christian Brauner Very nice! Highly appreciated! > --- > net/unix/af_unix.c | 90 > +++++++++++++++++++++++++++++++++++++++++++++++------- > 1 file changed, 79 insertions(+), 11 deletions(-) > > diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c > index f78a2492826f..83b5aebf499e 100644 > --- a/net/unix/af_unix.c > +++ b/net/unix/af_unix.c > @@ -100,6 +100,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -643,6 +644,14 @@ static void unix_sock_destructor(struct sock *sk) > return; > } > > + if (sock_flag(sk, SOCK_RCU_FREE)) { > + pr_info("Attempting to release RCU protected socket with sleeping > locks: %p\n", sk); > + return; > + } unix-sockets do not use `SOCK_RCU_FREE`, but even if they did, doesn't this flag imply that the destructor is delayed via `call_rcu`, and thus *IS* allowed to sleep? And then, sleeping in the destructor is always safe, isn't it? `SOCK_RCU_FREE` just guarantees that it is delayed for at least an RCU grace period, right? Not sure, what you are getting at here, but I might be missing something obvious as well. Regardless, wouldn't you want WARN_ON_ONCE() rather than pr_info? Otherwise looks good to me! David