* [PATCH] debugfs: Make debugfs_allow RO after init
@ 2021-04-05 21:39 Kees Cook
2021-04-06 5:59 ` Peter.Enderborg
0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2021-04-05 21:39 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Kees Cook, Peter Enderborg, Rafael J. Wysocki, linux-kernel
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
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] debugfs: Make debugfs_allow RO after init
2021-04-05 21:39 [PATCH] debugfs: Make debugfs_allow RO after init Kees Cook
@ 2021-04-06 5:59 ` Peter.Enderborg
0 siblings, 0 replies; 2+ messages in thread
From: Peter.Enderborg @ 2021-04-06 5:59 UTC (permalink / raw)
To: keescook, gregkh; +Cc: rafael, linux-kernel
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-06 6:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 21:39 [PATCH] debugfs: Make debugfs_allow RO after init Kees Cook
2021-04-06 5:59 ` Peter.Enderborg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.