login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
January
»
14
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse mounts
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Serge E. Hallyn <serue@...>
To: Miklos Szeredi <miklos@...>
Cc: <akpm@...>, <hch@...>, <serue@...>, <viro@...>, <ebiederm@...>, <kzak@...>, <linux-fsdevel@...>, <linux-kernel@...>, <containers@...>, <util-linux-ng@...>
Subject:
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse mounts
Date: Monday, January 14, 2008 - 7:24 pm
Quoting Miklos Szeredi (
miklos@szeredi.hu
):
quoted text
> From: Miklos Szeredi <mszeredi@suse.cz> > > Use FS_SAFE for "fuse" fs type, but not for "fuseblk". > > FUSE was designed from the beginning to be safe for unprivileged users. This > has also been verified in practice over many years. In addition unprivileged > mounts require the parent mount to be owned by the user, which is more strict > than the current userspace policy. > > This will enable future installations to remove the suid-root fusermount > utility. > > Don't require the "user_id=" and "group_id=" options for unprivileged mounts, > but if they are present, verify them for sanity. > > Disallow the "allow_other" option for unprivileged mounts. > > Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Sounds like a sysctl to enable FS_SAFE for fuse will make this patch acceptable to everyone?
quoted text
> --- > > Index: linux/fs/fuse/inode.c > =================================================================== > --- linux.orig/fs/fuse/inode.c 2008-01-03 17:13:13.000000000 +0100 > +++ linux/fs/fuse/inode.c 2008-01-03 21:28:01.000000000 +0100 > @@ -357,6 +357,19 @@ static int parse_fuse_opt(char *opt, str > d->max_read = ~0; > d->blksize = 512; > > + /* > + * For unprivileged mounts use current uid/gid. Still allow > + * "user_id" and "group_id" options for compatibility, but > + * only if they match these values. > + */ > + if (!capable(CAP_SYS_ADMIN)) { > + d->user_id = current->uid; > + d->user_id_present = 1; > + d->group_id = current->gid; > + d->group_id_present = 1; > + > + } > + > while ((p = strsep(&opt, ",")) != NULL) { > int token; > int value; > @@ -385,6 +398,8 @@ static int parse_fuse_opt(char *opt, str > case OPT_USER_ID: > if (match_int(&args[0], &value)) > return 0; > + if (d->user_id_present && d->user_id != value) > + return 0; > d->user_id = value; > d->user_id_present = 1; > break; > @@ -392,6 +407,8 @@ static int parse_fuse_opt(char *opt, str > case OPT_GROUP_ID: > if (match_int(&args[0], &value)) > return 0; > + if (d->group_id_present && d->group_id != value) > + return 0; > d->group_id = value; > d->group_id_present = 1; > break; > @@ -596,6 +613,10 @@ static int fuse_fill_super(struct super_ > if (!parse_fuse_opt((char *) data, &d, is_bdev)) > return -EINVAL; > > + /* This is a privileged option */ > + if ((d.flags & FUSE_ALLOW_OTHER) && !capable(CAP_SYS_ADMIN)) > + return -EPERM; > + > if (is_bdev) { > #ifdef CONFIG_BLOCK > if (!sb_set_blocksize(sb, d.blksize)) > @@ -696,9 +717,9 @@ static int fuse_get_sb(struct file_syste > static struct file_system_type fuse_fs_type = { > .owner = THIS_MODULE, > .name = "fuse", > - .fs_flags = FS_HAS_SUBTYPE, > .get_sb = fuse_get_sb, > .kill_sb = kill_anon_super, > + .fs_flags = FS_HAS_SUBTYPE | FS_SAFE, > }; > > #ifdef CONFIG_BLOCK > > --
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[patch 7/9] unprivileged mounts: allow unprivileged fuse mou...
, Miklos Szeredi
, (Tue Jan 8, 7:35 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Serge E. Hallyn
, (Mon Jan 14, 7:24 pm)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Miklos Szeredi
, (Tue Jan 15, 6:29 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Serge E. Hallyn
, (Tue Jan 15, 9:35 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Pavel Machek
, (Tue Jan 8, 5:46 pm)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Miklos Szeredi
, (Tue Jan 8, 6:42 pm)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Nigel Cunningham
, (Tue Jan 8, 7:56 pm)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Szabolcs Szakacsits
, (Wed Jan 9, 5:19 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Miklos Szeredi
, (Wed Jan 9, 4:47 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Pavel Machek
, (Wed Jan 9, 7:12 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Nigel Cunningham
, (Wed Jan 9, 5:29 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Pavel Machek
, (Tue Jan 8, 6:58 pm)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Miklos Szeredi
, (Wed Jan 9, 5:11 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Pavel Machek
, (Wed Jan 9, 7:33 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Miklos Szeredi
, (Wed Jan 9, 9:16 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Pavel Machek
, (Wed Jan 9, 9:35 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Miklos Szeredi
, (Wed Jan 9, 9:48 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Pavel Machek
, (Wed Jan 9, 10:00 am)
Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse...
, Miklos Szeredi
, (Wed Jan 9, 10:14 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Washington Odhiambo
Weird Problem with NAT - more details
Greg Kroah-Hartman
[PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO
Tarkan Erimer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Andrew Morton
-mm merge plans for 2.6.23
git
:
linux-netdev
:
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 0/37] dccp: Feature negotiation - last call for comments
David Miller
Re: [GIT]: Networking
Denys Fedoryshchenko
thousands of classes, e1000 TX unit hang
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
5 users
and
517 guests
online.
Online users
strcmp
maheshdm
racheldavison
reversephone
carminebuckner5
Syndicate