提交 2b9af37e 编写于 作者: K Kees Cook 提交者: Zheng Zengkai

debugfs: Make debugfs_allow RO after init

stable inclusion
from stable-5.10.38
commit c5dffd422145ee12ae0cd4a1aaf7b8c83624468a
bugzilla: 51875
CVE: NA

--------------------------------

commit 312723a0 upstream.

Since debugfs_allow is only set at boot time during __init, make it
read-only after being set.

Fixes: a24c6f7b ("debugfs: Add access restriction option")
Cc: Peter Enderborg <peter.enderborg@sony.com>
Reviewed-by: NPeter Enderborg <peter.enderborg@sony.com>
Signed-off-by: NKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210405213959.3079432-1-keescook@chromium.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 5025797b
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static struct vfsmount *debugfs_mount; static struct vfsmount *debugfs_mount;
static int debugfs_mount_count; static int debugfs_mount_count;
static bool debugfs_registered; 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 * Don't allow access attributes to be changed whilst the kernel is locked down
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册