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=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 98CBAC352A3 for ; Thu, 13 Feb 2020 22:48:25 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id EA3932073A for ; Thu, 13 Feb 2020 22:48:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="dRYW8Mem" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA3932073A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-17817-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 7596 invoked by uid 550); 13 Feb 2020 22:48:18 -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 7573 invoked from network); 13 Feb 2020 22:48:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rVdHJ1r/9FxJmwhDqRkVHSIn1Ry+lO3z+KpnaUuqwYk=; b=dRYW8MemR37cE0uru6NTUES5Od7vEqzfZmb/KMY93QEjURoq6DE5QcXLZ6JJL9HB8V KfvM/ZKQbYsF7Zy+x1PnUgqdmV3x1lbxpWU+BFmhJglL6UqALgYvF3IltbUH8c3PxzFq KRLtkM5e8bHrUc0004IuGa/Hy6940Rjrv4zzw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rVdHJ1r/9FxJmwhDqRkVHSIn1Ry+lO3z+KpnaUuqwYk=; b=nhA70XOf+uumc8zNCPMnExWUErog0kuffxL1b6w/67EWdxTiMgJDwBmz9+2OsbEde4 X66lIaP7OL6lUe3p6Zu36JdIXDsq7uN51LSqIxYmxjADNTbDvVD6o6UYQVc1YMwOd9iu iZyrWhzd/fIoyCIiamXoblO4LrRJOSvP/gMBRZIm3cCQNwe8XyS+/Dq/WSgI1kxNs9yy uJkniiVn2SCe6kOywHSLUWmIPUlXClYUwJd6KViX5jSOa24UfWzjOy+/3Vjq+uv9EA2l MCuBIWYLPfqbwGjgIPWK/BIMGhmdiNJQANMzWNsBIgBZiAJ2ecns+ftBsQ5+w+leJdP3 +MdA== X-Gm-Message-State: APjAAAXI7F3rPjI86SP0WmgJUPSviHtsdkiOqjHTfmXYEZD123Xw06V4 bt18gBiAmr2/Ei3oQxpKlBRBAkKvQOI= X-Google-Smtp-Source: APXvYqwruhxY3I98YsQtzDkSyyL0e2ANkyjTFWI4IC1Q87Nn88R70c5WR9JqRUqRNhmqauZtpAiynw== X-Received: by 2002:a2e:9587:: with SMTP id w7mr65201ljh.42.1581634086719; Thu, 13 Feb 2020 14:48:06 -0800 (PST) X-Received: by 2002:a2e:88c5:: with SMTP id a5mr35496ljk.201.1581634084790; Thu, 13 Feb 2020 14:48:04 -0800 (PST) MIME-Version: 1.0 References: <20200212200335.GO23230@ZenIV.linux.org.uk> <20200212203833.GQ23230@ZenIV.linux.org.uk> <20200212204124.GR23230@ZenIV.linux.org.uk> <87lfp7h422.fsf@x220.int.ebiederm.org> <87pnejf6fz.fsf@x220.int.ebiederm.org> <20200213055527.GS23230@ZenIV.linux.org.uk> <20200213222350.GU23230@ZenIV.linux.org.uk> In-Reply-To: <20200213222350.GU23230@ZenIV.linux.org.uk> From: Linus Torvalds Date: Thu, 13 Feb 2020 14:47:48 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 07/11] proc: flush task dcache entries from all procfs instances To: Al Viro Cc: "Eric W. Biederman" , 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 Content-Type: text/plain; charset="UTF-8" On Thu, Feb 13, 2020 at 2:23 PM Al Viro wrote: > > I'd been thinking of ->d_fsdata pointing to a structure with list_head > and a (non-counting) task_struct pointer for those guys. Allocated > on lookup, of course (as well as readdir ;-/) and put on the list > at the same time. Hmm. That smells like potentially a lot of small allocations, and making readdir() even nastier. Do we really want to create the dentries at readdir time? We do now (with proc_fill_cache()) but do we actually _need_ to? I guess a lot of readdir users end up doing a stat on it immediately afterwards. I think right now we do it to get the inode number, and maybe that is a basic requirement (even if I don't think it's really stable - an inode could be evicted and then the ino changes, no?) Ho humm. This all doesn't make me happy. But I guess the proof is in the pudding - and if you come up with a good patch, I won't complain. Linus