Skip to content

Commit

Permalink
debugfs: Make debugfs_allow RO after init
Browse files Browse the repository at this point in the history
Since debugfs_allow is only set at boot time during __init, make it
read-only after being set.

Fixes: a24c6f7 ("debugfs: Add access restriction option")
Cc: Peter Enderborg <peter.enderborg@sony.com>
Reviewed-by: Peter Enderborg <peter.enderborg@sony.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210405213959.3079432-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
kees authored and gregkh committed Apr 9, 2021
1 parent c2f3f75 commit 312723a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/debugfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 312723a

Please sign in to comment.