lkml.org 
[lkml]   [2011]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] debugfs: only allow root access to debugging interfaces
On Tue, Feb 22, 2011 at 11:29:15PM +0300, Dan Carpenter wrote:
> On Tue, Feb 22, 2011 at 11:33:14AM -0800, Greg KH wrote:
> > Again, let's fix the real problems here, world-writable debugfs files.
>
> We could just ban them?

That would be nice. This would be much better than relying on
check_patch.pl. Perhaps do this for /sys and /proc/sys too?

Acked-by: Kees Cook <kees.cook@canonical.com>

>
> diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
> index e7a7a2f..03ae095 100644
> --- a/fs/debugfs/inode.c
> +++ b/fs/debugfs/inode.c
> @@ -223,6 +223,9 @@ struct dentry *debugfs_create_file(const char *name, mode_t mode,
>
> pr_debug("debugfs: creating file '%s'\n",name);
>
> + /* don't allow world writable files */
> + mode &= ~S_IWOTH;
> +
> error = simple_pin_fs(&debug_fs_type, &debugfs_mount,
> &debugfs_mount_count);
> if (error)
--
Kees Cook
Ubuntu Security Team


\
 
 \ /
  Last update: 2011-02-22 21:37    [W:0.149 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site