From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 880DBC11D00 for ; Thu, 20 Feb 2020 23:41:34 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id DF11B207FD for ; Thu, 20 Feb 2020 23:41:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF11B207FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xmission.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-17875-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 14295 invoked by uid 550); 20 Feb 2020 23:41:28 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 14258 invoked from network); 20 Feb 2020 23:41:27 -0000 From: ebiederm@xmission.com (Eric W. Biederman) To: Al Viro Cc: Linus Torvalds , LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Kees Cook , Oleg Nesterov , Solar Designer References: <20200212203833.GQ23230@ZenIV.linux.org.uk> <20200212204124.GR23230@ZenIV.linux.org.uk> <87lfp7h422.fsf@x220.int.ebiederm.org> <87pnejf6fz.fsf@x220.int.ebiederm.org> <871rqpaswu.fsf_-_@x220.int.ebiederm.org> <87blpt9e6m.fsf_-_@x220.int.ebiederm.org> <20200220225420.GR23230@ZenIV.linux.org.uk> <20200220230309.GS23230@ZenIV.linux.org.uk> Date: Thu, 20 Feb 2020 17:39:14 -0600 In-Reply-To: <20200220230309.GS23230@ZenIV.linux.org.uk> (Al Viro's message of "Thu, 20 Feb 2020 23:03:09 +0000") Message-ID: <87blps7rrx.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1j4vRS-0003Oz-LG;;;mid=<87blps7rrx.fsf@x220.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19OdZjKNTBNxrAmd9oO+cyfw3wUEl55Vpc= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH 4/7] proc: Use d_invalidate in proc_prune_siblings_dcache X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Al Viro writes: > On Thu, Feb 20, 2020 at 10:54:20PM +0000, Al Viro wrote: >> On Thu, Feb 20, 2020 at 02:49:53PM -0600, Eric W. Biederman wrote: >> > >> > The function d_prune_aliases has the problem that it will only prune >> > aliases thare are completely unused. It will not remove aliases for >> > the dcache or even think of removing mounts from the dcache. For that >> > behavior d_invalidate is needed. >> > >> > To use d_invalidate replace d_prune_aliases with d_find_alias >> > followed by d_invalidate and dput. This is safe and complete >> > because no inode in proc has any hardlinks or aliases. >> >> s/no inode.*/it's a fucking directory inode./ > > Wait... You are using it for sysctls as well? Ho-hum... The thing is, > for sysctls you are likely to run into consequent entries with the > same superblock, making for a big pile of useless playing with > ->s_active... And yes, that applied to mainline as well Which is why I worked to merge the two cases since they were so close. Fewer things to fix and more eyeballs on the code. Eric