LKML Archive mirror
 help / color / mirror / Atom feed
From: <Peter.Enderborg@sony.com>
To: <keescook@chromium.org>, <gregkh@linuxfoundation.org>
Cc: <rafael@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] debugfs: Make debugfs_allow RO after init
Date: Tue, 6 Apr 2021 05:59:06 +0000	[thread overview]
Message-ID: <88e49a04-cbd7-c9ee-fd4f-13d4dae8d5e2@sony.com> (raw)
In-Reply-To: <20210405213959.3079432-1-keescook@chromium.org>

On 4/5/21 11:39 PM, Kees Cook wrote:
> Since debugfs_allow is only set at boot time during __init, make it
> read-only after being set.
>
> Cc: Peter Enderborg <peter.enderborg@sony.com>
> Fixes: a24c6f7bc923 ("debugfs: Add access restriction option")
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  fs/debugfs/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
> index 22e86ae4dd5a..1d252164d97b 100644
> --- a/fs/debugfs/inode.c
> +++ b/fs/debugfs/inode.c
> @@ -35,7 +35,7 @@
>  static struct vfsmount *debugfs_mount;
>  static int debugfs_mount_count;
>  static bool debugfs_registered;
> -static unsigned int debugfs_allow = DEFAULT_DEBUGFS_ALLOW_BITS;
> +static unsigned int debugfs_allow __ro_after_init = DEFAULT_DEBUGFS_ALLOW_BITS;
>  
>  /*
>   * Don't allow access attributes to be changed whilst the kernel is locked down

Tnx. Looks good to me.

You can add:

Reviewed-by: Peter Enderborg <peter.enderborg@sony.com>


      reply	other threads:[~2021-04-06  6:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-05 21:39 [PATCH] debugfs: Make debugfs_allow RO after init Kees Cook
2021-04-06  5:59 ` Peter.Enderborg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88e49a04-cbd7-c9ee-fd4f-13d4dae8d5e2@sony.com \
    --to=peter.enderborg@sony.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).