Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp248572pxu; Tue, 5 Jan 2021 09:48:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvcmPuZbMEw0EYJ2A7ZnCHOJN5pjUOsyEGdpBczgRBnhMTADDU9R/78VvaMvcqh9G8au/L X-Received: by 2002:a50:eb96:: with SMTP id y22mr914317edr.91.1609868910612; Tue, 05 Jan 2021 09:48:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609868910; cv=none; d=google.com; s=arc-20160816; b=dJRER5hQVLsm6JTDqQGZPhQ+j+DxSfMGdDqBB4AFZ5mkyEheGqDXSOdmXtSp/PuEkk pZ5Hdvth91nsY378o8B+HPaPgMEEWyoNthExHp74cjQCzsUhhmtdHogbkOD9OBP4FkHm KUd9Hv1URZ2vmbpi4aoi/EtJdHtMCljnNhKKr//lXSJXeNUOLbKqCqL16nghL58uibzh /9B/6r1nrU78t9hnBq/X1yRahdaWS2u1qmBT+LDaOp/j4B4I54dnxp27Z8LBX5PJhiYv IU1TyC1ueh3n2/NxqlGDorFEy/ZlxNGenr/xBZj+aho/igIvaRoWu7TBEL6JABy0mrGi O0rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=2dusD9Ssq3Mix+FawHtIm0XE5orRI1Uxs3J/ksDdIAc=; b=l3zzZE/8vxlpA1iWBqk2pXzK11epDm1KPzo4Lr1WJphVUlCdcct5Q5Ww/S1fpqCucY NlBDggOLkBBUikkExx1ruKscWrSpavil6urnBqeGxssoOFxgUZPFJlwl22fvd6wAVB8l n4LZY15oTbPoORUSZ2w4VFwTY3XHh0ytolw43bMo+GiIt3OZkeMn555fqHqRp0Llk+XF UvyPpkZpcaYNVkJKORwypu0/MEJpgJZuJEVi8nWe4DxDZ/zxcUxETjqpRidllfo+AV+N 6vWI1Mt8yVBoMXoHD21vK3CrIdRidHvsokyoCPfPIR5oFn+gWJq5FS0cL45F9cdoh9ct uW3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si158113edo.164.2021.01.05.09.48.06; Tue, 05 Jan 2021 09:48:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730618AbhAERq1 (ORCPT + 99 others); Tue, 5 Jan 2021 12:46:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbhAERq1 (ORCPT ); Tue, 5 Jan 2021 12:46:27 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B76FCC061574; Tue, 5 Jan 2021 09:45:46 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwqOh-0077dB-4T; Tue, 05 Jan 2021 17:45:31 +0000 Date: Tue, 5 Jan 2021 17:45:31 +0000 From: Al Viro To: Stephen Brennan Cc: Alexey Dobriyan , James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org, Paul Moore , Stephen Smalley , Eric Paris , selinux@vger.kernel.org, Casey Schaufler , Eric Biederman , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Matthew Wilcox Subject: Re: [PATCH v4] proc: Allow pid_revalidate() during LOOKUP_RCU Message-ID: <20210105174531.GW3579531@ZenIV.linux.org.uk> References: <20210104232123.31378-1-stephen.s.brennan@oracle.com> <20210105055935.GT3579531@ZenIV.linux.org.uk> <20210105165005.GV3579531@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210105165005.GV3579531@ZenIV.linux.org.uk> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 05, 2021 at 04:50:05PM +0000, Al Viro wrote: > struct dentry *d_find_alias_rcu(struct inode *inode) > { > struct hlist_head *l = &inode->i_dentry; > struct dentry *de = NULL; > > spin_lock(&inode->i_lock); > // ->i_dentry and ->i_rcu are colocated, but the latter won't be > // used without having I_FREEING set, which means no aliases left > if (inode->i_state & I_FREEING) { > spin_unlock(&inode->i_lock); > return NULL; > } > // we can safely access inode->i_dentry > if (hlist_empty(p)) { if (hlist_empty(l)) { obviously...