Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2123753iob; Fri, 20 May 2022 02:32:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfn4BxPuRtNd/lTSlLWwQ3U/4z6fbcShn9egf0F9y6mt9UWLWyxJFwa98vMqfXMuJfCkUx X-Received: by 2002:a17:907:9712:b0:6f4:ab87:5723 with SMTP id jg18-20020a170907971200b006f4ab875723mr7839562ejc.430.1653039120717; Fri, 20 May 2022 02:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653039120; cv=none; d=google.com; s=arc-20160816; b=VIb+LvQXZzUZoy8c9NI8xzTofXuynUx9edho5eqDFNFEt0Aqb6YoIr/PdZHARy+Jn4 TRlYz23yB6DHymNkbHd393BF0YgxY74SmQuu4MitjkPgIDtfj5KkEqroGt+ls9zmD8Qs PcpVNoDWu52jNDP19lVsradWqjMZbhIEtk7QDE/XETnv6kiky1kD4zBLvLcn+wpALgBg 2GOBlRia+RbG6ujy9hZdSinYfAfvqGC00Xgz1/te+X7HuVm3ZJ8DR/50BfK+RF250n3x ddXigMaB51UbpgviohD8ELhSb40Ldx9N23LKefVf278OT3WNip5bTOfsJVP+YQ/eobT7 mnfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lX20NL3YNPaKjNecI4oDdq3acoU2kOL0ZbPMHMv9mB0=; b=G6kUg2jiEo661Q8pALLIrjTo5qU0ekprC9is2Xy3VFio+qVvcKmfyGq2XFb5WxXDHO Oi6HPVotxShbWkW2FsCWDvzTcaOkD28PQbig6iOzpuXBfyXcHUDxvRQiuzXvKGl8md0M ZkIv02eSj1DLnKIIPjiqhq32vsA/j9VmQxrKNKfC6wGzHxlHnw30kyZRzfQBpRA9L44u 4PE4EXvjc+CR5rbD1h8oY//GILQKBpZGQALouy8m3phe0SfcyZgOmrOfgBRK9YLVzfuX F7Bukin6qAMsPgIPr5Qr6jM2vubGSzdNyvPyeZtaBobw7Ypaa6gXyZEZHCsan9cWRlDH vSZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QUhqUNwj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z20-20020a05640240d400b0042b34c92366si509695edb.299.2022.05.20.02.31.34; Fri, 20 May 2022 02:32:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QUhqUNwj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbiETEB4 (ORCPT + 99 others); Fri, 20 May 2022 00:01:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231720AbiETEBy (ORCPT ); Fri, 20 May 2022 00:01:54 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6222614A25B for ; Thu, 19 May 2022 21:01:52 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id j24so9797295wrb.1 for ; Thu, 19 May 2022 21:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lX20NL3YNPaKjNecI4oDdq3acoU2kOL0ZbPMHMv9mB0=; b=QUhqUNwjiYBBL+Gfy7USDRKlfhCB5po25WZwgPlSiSkUXf8omWvdSvXZzxRV41w1tT d5C/MVpxWJNzqMqMn4BsGlEqIb6rOVIxP+yf5DJ3CcD/CMFR7a+o3Nxfo0tiHS41+QJx 1G0voWhXE97nNh8TDu9IYnnRSfvefCogP4VsB5M0y74VMQ5qGopMDi1VQqUGm6PnvD78 YluERYOhs/tCKgwebfwVE2yQreNBgLUaB4ZY4z6xzZTQ7LXJk9AbCoT54oExEPxtuCAM DF3gvipca18rnRT53tde7E+gUZik7VP0hR/Z6h4m5Gl7iRVkpIrQcRhWqQ2jBr0jnUJX zgOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lX20NL3YNPaKjNecI4oDdq3acoU2kOL0ZbPMHMv9mB0=; b=pqRcSLaG+as0vJXArPrpNnMwydtI6wmgpJ4zTLNmZo8WEVdGqixb+rNGIdP0S/8Wk0 m3xn1A/wHN6BPIKmnnL7QRZe3W4SE4ciiddpZUh+b50R+n5fgR3wtH0NSu8lhnDDcbhM WSct/OaabO7/A6toEPP8P4jofGYS3Yv61wOxz68lDQrKVRRrgMWB+dLsGK8slRM5f3HF z0cXcuItLkOsP0gGWEsdr4CyvQwBc65sb4O1ZJgNOfI8AZ4QsxMFeHNmxajFCc0ZypC4 Ogqs3Q5Z6zEbE2abaVlBzWgEIXf9+21RIgMd6nHlyf7nTw2iJEAgR2JtmxnBHdgOk1QC TnuQ== X-Gm-Message-State: AOAM533GCeLZ+fPAWk3cKUbXZaxz7/meGIGaVEXBbnxrUDI8ozjcDTw/ rzo6+SY1SHAR43VGACjDs7safT0j1/lmu3bf9IU8qw== X-Received: by 2002:a5d:5846:0:b0:20c:7407:5fa1 with SMTP id i6-20020a5d5846000000b0020c74075fa1mr6448325wrf.116.1653019310813; Thu, 19 May 2022 21:01:50 -0700 (PDT) MIME-Version: 1.0 References: <20220519214021.3572840-1-kaleshsingh@google.com> <202205191848.DEE05F6@keescook> In-Reply-To: <202205191848.DEE05F6@keescook> From: Kalesh Singh Date: Thu, 19 May 2022 21:01:39 -0700 Message-ID: Subject: Re: [RFC PATCH] procfs: Add file path and size to /proc//fdinfo To: Kees Cook Cc: Ioannis Ilkos , "T.J. Mercier" , Suren Baghdasaryan , "Cc: Android Kernel" , Jonathan Corbet , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Andrew Morton , Christoph Anton Mitterer , Mike Rapoport , Colin Cross , Randy Dunlap , LKML , linux-fsdevel , "open list:DOCUMENTATION" , Linux Media Mailing List , DRI mailing list , "moderated list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 19, 2022 at 6:50 PM Kees Cook wrote: > > On Thu, May 19, 2022 at 02:40:15PM -0700, Kalesh Singh wrote: > > [...] > > + seq_file_path(m, file, "\n"); > > + seq_putc(m, '\n'); > > > > /* show_fd_locks() never deferences files so a stale value is safe */ > > show_fd_locks(m, file, files); > > This comment implies "file" might be stale? Does that mean anything for > the above seq_file_path()? Hi Kees. Thanks for taking a look. The comment above says the "files" pointer can be stale. It doesn't affect our use of "file" here. seq_show() takes the reference with get_file() so "file" wouldn't be destroyed from under us. Thanks, Kalesh > > -- > Kees Cook