diff options
author | Kees Cook <keescook@chromium.org> | 2021-04-05 14:39:59 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-19 10:30:05 +0200 |
commit | f784dd88f6ae87e2d0d7726e5a3ad0469b2d0ccf (patch) | |
tree | e582526e463359284194e5fb7c1bb7365b1afcae | |
parent | 250c9dde33e99612d0144fe7c50d835981596b43 (diff) | |
download | linux-stable-f784dd88f6ae87e2d0d7726e5a3ad0469b2d0ccf.tar.gz linux-stable-f784dd88f6ae87e2d0d7726e5a3ad0469b2d0ccf.tar.bz2 linux-stable-f784dd88f6ae87e2d0d7726e5a3ad0469b2d0ccf.zip |
debugfs: Make debugfs_allow RO after init
commit 312723a0b34d6d110aa4427a982536bb36ab8471 upstream.
Since debugfs_allow is only set at boot time during __init, make it
read-only after being set.
Fixes: a24c6f7bc923 ("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>
-rw-r--r-- | fs/debugfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 86c7f0489620..720d65f224f0 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 |