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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0A08C4332F for ; Fri, 8 Oct 2021 21:13:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 880B860FD9 for ; Fri, 8 Oct 2021 21:13:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243423AbhJHVPI (ORCPT ); Fri, 8 Oct 2021 17:15:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231696AbhJHVPH (ORCPT ); Fri, 8 Oct 2021 17:15:07 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5145C061755 for ; Fri, 8 Oct 2021 14:13:11 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id d13-20020a17090ad3cd00b0019e746f7bd4so10258166pjw.0 for ; Fri, 08 Oct 2021 14:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=F0j9Fen+aM1yxtAVTmt6zwsss9sN5UsLCk44GHH1tRc=; b=I+McrbgmDL8gZ9vmtX1aR7+zkzhDrlHhXT6iEzjY4OCKkruLZDBi+tzb3viHWvPBBY kW2Us4im1MyQTWLJHDidgCouWJsWR1fzIwUGgK8+FBItkM6TWjIfpDSi5vv4VKXHDqoI OyfVYPUddfURQDYvCN/P/GevbyB1QLdePw59Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=F0j9Fen+aM1yxtAVTmt6zwsss9sN5UsLCk44GHH1tRc=; b=iM0NmBkS7u4y12yuDgbip1v9ZAtoxruI6qEG/Yp4C1dENdnVbPIF6cczsaYFvgUdzx cT7+4CpVJvx9CVwW0CiPfIpoPb4AJnIP6EvhLWfsJV9f+cuRIVDvRqQfvW2dpRNeoxJe ZuMJtd9imsa4o2sNXehuy0xdIWy4D+vvDQkKKTP1tgJxrF2f+Do3/3p9/tkP+LfLQ7LV eZYctnvmcHviKC8kQGCUe+/t0PpG/m2e0K3/9OquWzO0nKN+o3LH5X0nf7sehKClYRE4 IAKe0a+aMHZ+FZGdF1ruBI9VAmJHC0pK1d8l+wwL1sofczjWgCG1ATkRZQQxNPNfjDJu HGow== X-Gm-Message-State: AOAM531Y9BMhVUi0vq5At3dc1sO2ZGhmUkvdBU1ANcsFTIYG73doj0wR HqpFYKGK4nsfytQVz+oxShMhEw== X-Google-Smtp-Source: ABdhPJw7VKHrHn5Ve+YJUHXmXb4Y/SdM39YgZAgr2mjSF0lGDycy5YuHBe+qaxeygUETUBv7bjuAQg== X-Received: by 2002:a17:90a:6c97:: with SMTP id y23mr14115452pjj.117.1633727591243; Fri, 08 Oct 2021 14:13:11 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id nn14sm147691pjb.27.2021.10.08.14.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 14:13:10 -0700 (PDT) Date: Fri, 8 Oct 2021 14:13:09 -0700 From: Kees Cook To: David Hildenbrand Cc: Rasmus Villemoes , John Hubbard , Suren Baghdasaryan , Michal Hocko , Pavel Machek , Andrew Morton , Colin Cross , Sumit Semwal , Dave Hansen , Matthew Wilcox , "Kirill A . Shutemov" , Vlastimil Babka , Johannes Weiner , Jonathan Corbet , Al Viro , Randy Dunlap , Kalesh Singh , Peter Xu , rppt@kernel.org, Peter Zijlstra , Catalin Marinas , vincenzo.frascino@arm.com, Chinwen Chang =?utf-8?B?KOW8temMpuaWhyk=?= , Axel Rasmussen , Andrea Arcangeli , Jann Horn , apopple@nvidia.com, Yu Zhao , Will Deacon , fenghua.yu@intel.com, thunder.leizhen@huawei.com, Hugh Dickins , feng.tang@intel.com, Jason Gunthorpe , Roman Gushchin , Thomas Gleixner , krisman@collabora.com, Chris Hyser , Peter Collingbourne , "Eric W. Biederman" , Jens Axboe , legion@kernel.org, Rolf Eike Beer , Cyrill Gorcunov , Muchun Song , Viresh Kumar , Thomas Cedeno , sashal@kernel.org, cxfcosmos@gmail.com, LKML , linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm , kernel-team Subject: Re: [PATCH v10 3/3] mm: add anonymous vma name refcounting Message-ID: <202110081401.7AB25E4@keescook> References: <202110071111.DF87B4EE3@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 08, 2021 at 09:43:59AM +0200, David Hildenbrand wrote: > I'm going to point out that we already do have names for memfds. I just did the same here[1]. :P > [...] It's also displayed in /proc/self/maps. I missed that part! /me screams forever We really need to filter this at creation time. :( At least seq_file_path() escapes "\n" for it, but not "\r", so humans on a terminal could get very confused... $ ./memfd '^M0000000000000000-ffffffffffffffff rwxp 00000000 00:00 0 [stack]' & [1] 2953833 $ cat /proc/2953833/maps ... 0000000000000000-ffffffffffffffff rwxp 00000000 00:00 0 [stack] (deleted) ... -Kees [1] https://lore.kernel.org/lkml/202110081344.FE6A7A82@keescook -- Kees Cook