* [PATCH 02/25] userns: Convert gadgetfs to use kuid and kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
@ 2012-09-20 11:41 ` Eric W. Biederman
[not found] ` <1348141326-23355-2-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-20 11:41 ` [PATCH 03/25] userns: Convert usb functionfs to use kuid/kgid " Eric W. Biederman
` (19 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Greg Kroah-Hartman, Linux Containers,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi,
Eric W. Biederman
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Cc: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
drivers/usb/gadget/inode.c | 4 ++--
init/Kconfig | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index e58b164..7bd36c8 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1988,8 +1988,8 @@ gadgetfs_make_inode (struct super_block *sb,
if (inode) {
inode->i_ino = get_next_ino();
inode->i_mode = mode;
- inode->i_uid = default_uid;
- inode->i_gid = default_gid;
+ inode->i_uid = make_kuid(&init_user_ns, default_uid);
+ inode->i_gid = make_kgid(&init_user_ns, default_gid);
inode->i_atime = inode->i_mtime = inode->i_ctime
= CURRENT_TIME;
inode->i_private = data;
diff --git a/init/Kconfig b/init/Kconfig
index 60bdff2..633bde2 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -932,7 +932,6 @@ config UIDGID_CONVERTED
depends on NET_9P = n
# Filesystems
- depends on USB_GADGETFS = n
depends on USB_FUNCTIONFS = n
depends on DEVTMPFS = n
depends on XENFS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 03/25] userns: Convert usb functionfs to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-20 11:41 ` [PATCH 02/25] userns: Convert gadgetfs to use kuid and kgid " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
[not found] ` <1348141326-23355-3-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-21 9:32 ` Felipe Balbi
2012-09-20 11:41 ` [PATCH 04/25] userns: Convert devtmpfs to use GLOBAL_ROOT_UID and GLOBAL_ROOT_GID Eric W. Biederman
` (18 subsequent siblings)
20 siblings, 2 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Greg Kroah-Hartman, Linux Containers,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi,
Eric W. Biederman
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Cc: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
drivers/usb/gadget/f_fs.c | 23 ++++++++++++++++-------
init/Kconfig | 1 -
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index 8adc79d..f9ee4e0 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -220,8 +220,8 @@ struct ffs_data {
/* File permissions, written once when fs is mounted */
struct ffs_file_perms {
umode_t mode;
- uid_t uid;
- gid_t gid;
+ kuid_t uid;
+ kgid_t gid;
} file_perms;
/*
@@ -1143,10 +1143,19 @@ static int ffs_fs_parse_opts(struct ffs_sb_fill_data *data, char *opts)
break;
case 3:
- if (!memcmp(opts, "uid", 3))
- data->perms.uid = value;
+ if (!memcmp(opts, "uid", 3)) {
+ data->perms.uid = make_kuid(current_user_ns(), value);
+ if (!uid_valid(data->perms.uid)) {
+ pr_err("%s: unmapped value: %lu\n", opts, value);
+ return -EINVAL;
+ }
+ }
else if (!memcmp(opts, "gid", 3))
- data->perms.gid = value;
+ data->perms.gid = make_kgid(current_user_ns(), value);
+ if (!gid_valid(data->perms.gid)) {
+ pr_err("%s: unmapped value: %lu\n", opts, value);
+ return -EINVAL;
+ }
else
goto invalid;
break;
@@ -1175,8 +1184,8 @@ ffs_fs_mount(struct file_system_type *t, int flags,
struct ffs_sb_fill_data data = {
.perms = {
.mode = S_IFREG | 0600,
- .uid = 0,
- .gid = 0
+ .uid = GLOBAL_ROOT_UID,
+ .gid = GLOBAL_ROOT_GID,
},
.root_mode = S_IFDIR | 0500,
};
diff --git a/init/Kconfig b/init/Kconfig
index 633bde2..e7e0cc1 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -932,7 +932,6 @@ config UIDGID_CONVERTED
depends on NET_9P = n
# Filesystems
- depends on USB_FUNCTIONFS = n
depends on DEVTMPFS = n
depends on XENFS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
[parent not found: <1348141326-23355-3-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>]
* Re: [PATCH 03/25] userns: Convert usb functionfs to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-3-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
@ 2012-09-20 11:58 ` Greg Kroah-Hartman
0 siblings, 0 replies; 41+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-20 11:58 UTC (permalink / raw)
To: Eric W. Biederman
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, Linux Containers,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi
On Thu, Sep 20, 2012 at 04:41:44AM -0700, Eric W. Biederman wrote:
> From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
>
> Cc: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
> Cc: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
> Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Acked-by: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 03/25] userns: Convert usb functionfs to use kuid/kgid where appropriate
2012-09-20 11:41 ` [PATCH 03/25] userns: Convert usb functionfs to use kuid/kgid " Eric W. Biederman
[not found] ` <1348141326-23355-3-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
@ 2012-09-21 9:32 ` Felipe Balbi
1 sibling, 0 replies; 41+ messages in thread
From: Felipe Balbi @ 2012-09-21 9:32 UTC (permalink / raw)
To: Eric W. Biederman
Cc: linux-fsdevel, linux-kernel, Serge Hallyn, Linux Containers,
Greg Kroah-Hartman, Felipe Balbi
[-- Attachment #1: Type: text/plain, Size: 2412 bytes --]
On Thu, Sep 20, 2012 at 04:41:44AM -0700, Eric W. Biederman wrote:
> From: "Eric W. Biederman" <ebiederm@xmission.com>
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Felipe Balbi <balbi@ti.com>
> Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Felipe Balbi <balbi@ti.com>
> ---
> drivers/usb/gadget/f_fs.c | 23 ++++++++++++++++-------
> init/Kconfig | 1 -
> 2 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
> index 8adc79d..f9ee4e0 100644
> --- a/drivers/usb/gadget/f_fs.c
> +++ b/drivers/usb/gadget/f_fs.c
> @@ -220,8 +220,8 @@ struct ffs_data {
> /* File permissions, written once when fs is mounted */
> struct ffs_file_perms {
> umode_t mode;
> - uid_t uid;
> - gid_t gid;
> + kuid_t uid;
> + kgid_t gid;
> } file_perms;
>
> /*
> @@ -1143,10 +1143,19 @@ static int ffs_fs_parse_opts(struct ffs_sb_fill_data *data, char *opts)
> break;
>
> case 3:
> - if (!memcmp(opts, "uid", 3))
> - data->perms.uid = value;
> + if (!memcmp(opts, "uid", 3)) {
> + data->perms.uid = make_kuid(current_user_ns(), value);
> + if (!uid_valid(data->perms.uid)) {
> + pr_err("%s: unmapped value: %lu\n", opts, value);
> + return -EINVAL;
> + }
> + }
> else if (!memcmp(opts, "gid", 3))
> - data->perms.gid = value;
> + data->perms.gid = make_kgid(current_user_ns(), value);
> + if (!gid_valid(data->perms.gid)) {
> + pr_err("%s: unmapped value: %lu\n", opts, value);
> + return -EINVAL;
> + }
> else
> goto invalid;
> break;
> @@ -1175,8 +1184,8 @@ ffs_fs_mount(struct file_system_type *t, int flags,
> struct ffs_sb_fill_data data = {
> .perms = {
> .mode = S_IFREG | 0600,
> - .uid = 0,
> - .gid = 0
> + .uid = GLOBAL_ROOT_UID,
> + .gid = GLOBAL_ROOT_GID,
> },
> .root_mode = S_IFDIR | 0500,
> };
> diff --git a/init/Kconfig b/init/Kconfig
> index 633bde2..e7e0cc1 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -932,7 +932,6 @@ config UIDGID_CONVERTED
> depends on NET_9P = n
>
> # Filesystems
> - depends on USB_FUNCTIONFS = n
> depends on DEVTMPFS = n
> depends on XENFS = n
>
> --
> 1.7.5.4
>
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 04/25] userns: Convert devtmpfs to use GLOBAL_ROOT_UID and GLOBAL_ROOT_GID
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-20 11:41 ` [PATCH 02/25] userns: Convert gadgetfs to use kuid and kgid " Eric W. Biederman
2012-09-20 11:41 ` [PATCH 03/25] userns: Convert usb functionfs to use kuid/kgid " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
[not found] ` <1348141326-23355-4-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-20 11:41 ` [PATCH 05/25] userns: Convert hugetlbfs to use kuid/kgid where appropriate Eric W. Biederman
` (17 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Greg Kroah-Hartman, Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
drivers/base/devtmpfs.c | 4 ++--
init/Kconfig | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index deb4a45..147d1a4 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -309,8 +309,8 @@ static int handle_remove(const char *nodename, struct device *dev)
* before unlinking this node, reset permissions
* of possible references like hardlinks
*/
- newattrs.ia_uid = 0;
- newattrs.ia_gid = 0;
+ newattrs.ia_uid = GLOBAL_ROOT_UID;
+ newattrs.ia_gid = GLOBAL_ROOT_GID;
newattrs.ia_mode = stat.mode & ~0777;
newattrs.ia_valid =
ATTR_UID|ATTR_GID|ATTR_MODE;
diff --git a/init/Kconfig b/init/Kconfig
index e7e0cc1..96007af 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -932,7 +932,6 @@ config UIDGID_CONVERTED
depends on NET_9P = n
# Filesystems
- depends on DEVTMPFS = n
depends on XENFS = n
depends on 9P_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 05/25] userns: Convert hugetlbfs to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (2 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 04/25] userns: Convert devtmpfs to use GLOBAL_ROOT_UID and GLOBAL_ROOT_GID Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 11:41 ` [PATCH 06/25] userns: Convert xenfs to use kuid and kgid " Eric W. Biederman
` (16 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, William Irwin
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Note sysctl_hugetlb_shm_group can only be written in the root user
in the initial user namespace, so we can assume sysctl_hugetlb_shm_group
is in the initial user namespace.
Cc: William Irwin <wli-tGiaVUSOoeej7qYf8Sx8sA@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/hugetlbfs/inode.c | 16 +++++++++++-----
init/Kconfig | 1 -
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 8349a89..6e572c4 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -42,8 +42,8 @@ static const struct inode_operations hugetlbfs_dir_inode_operations;
static const struct inode_operations hugetlbfs_inode_operations;
struct hugetlbfs_config {
- uid_t uid;
- gid_t gid;
+ kuid_t uid;
+ kgid_t gid;
umode_t mode;
long nr_blocks;
long nr_inodes;
@@ -785,13 +785,17 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
case Opt_uid:
if (match_int(&args[0], &option))
goto bad_val;
- pconfig->uid = option;
+ pconfig->uid = make_kuid(current_user_ns(), option);
+ if (!uid_valid(pconfig->uid))
+ goto bad_val;
break;
case Opt_gid:
if (match_int(&args[0], &option))
goto bad_val;
- pconfig->gid = option;
+ pconfig->gid = make_kgid(current_user_ns(), option);
+ if (!gid_valid(pconfig->gid))
+ goto bad_val;
break;
case Opt_mode:
@@ -924,7 +928,9 @@ static struct vfsmount *hugetlbfs_vfsmount;
static int can_do_hugetlb_shm(void)
{
- return capable(CAP_IPC_LOCK) || in_group_p(sysctl_hugetlb_shm_group);
+ kgid_t shm_group;
+ shm_group = make_kgid(&init_user_ns, sysctl_hugetlb_shm_group);
+ return capable(CAP_IPC_LOCK) || in_group_p(shm_group);
}
struct file *hugetlb_file_setup(const char *name, unsigned long addr,
diff --git a/init/Kconfig b/init/Kconfig
index 96007af..7ee6e19 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -954,7 +954,6 @@ config UIDGID_CONVERTED
depends on HFS_FS = n
depends on HFSPLUS_FS = n
depends on HPFS_FS = n
- depends on HUGETLBFS = n
depends on ISO9660_FS = n
depends on JFFS2_FS = n
depends on JFS_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 06/25] userns: Convert xenfs to use kuid and kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (3 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 05/25] userns: Convert hugetlbfs to use kuid/kgid where appropriate Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 11:41 ` [PATCH 07/25] userns: Convert adfs " Eric W. Biederman
` (15 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Ian Campbell, Konrad Rzeszutek Wilk, Linux Containers,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Eric W. Biederman
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Ian Campbell <ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
drivers/xen/xenfs/super.c | 3 ++-
init/Kconfig | 2 --
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c
index a84b53c..459b9ac 100644
--- a/drivers/xen/xenfs/super.c
+++ b/drivers/xen/xenfs/super.c
@@ -30,7 +30,8 @@ static struct inode *xenfs_make_inode(struct super_block *sb, int mode)
if (ret) {
ret->i_mode = mode;
- ret->i_uid = ret->i_gid = 0;
+ ret->i_uid = GLOBAL_ROOT_UID;
+ ret->i_gid = GLOBAL_ROOT_GID;
ret->i_blocks = 0;
ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
}
diff --git a/init/Kconfig b/init/Kconfig
index 7ee6e19..485c60a 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -932,8 +932,6 @@ config UIDGID_CONVERTED
depends on NET_9P = n
# Filesystems
- depends on XENFS = n
-
depends on 9P_FS = n
depends on ADFS_FS = n
depends on AFFS_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 07/25] userns: Convert adfs to use kuid and kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (4 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 06/25] userns: Convert xenfs to use kuid and kgid " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 11:41 ` [PATCH 08/25] userns: Convert befs to use kuid/kgid " Eric W. Biederman
` (14 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/adfs/adfs.h | 4 ++--
fs/adfs/inode.c | 4 ++--
fs/adfs/super.c | 21 +++++++++++++--------
init/Kconfig | 1 -
4 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/fs/adfs/adfs.h b/fs/adfs/adfs.h
index 718ac1f..585adaf 100644
--- a/fs/adfs/adfs.h
+++ b/fs/adfs/adfs.h
@@ -46,8 +46,8 @@ struct adfs_sb_info {
struct adfs_discmap *s_map; /* bh list containing map */
struct adfs_dir_ops *s_dir; /* directory operations */
- uid_t s_uid; /* owner uid */
- gid_t s_gid; /* owner gid */
+ kuid_t s_uid; /* owner uid */
+ kgid_t s_gid; /* owner gid */
umode_t s_owner_mask; /* ADFS owner perm -> unix perm */
umode_t s_other_mask; /* ADFS other perm -> unix perm */
int s_ftsuffix; /* ,xyz hex filetype suffix option */
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index 1dab6a1..e9bad50 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -304,8 +304,8 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr)
* we can't change the UID or GID of any file -
* we have a global UID/GID in the superblock
*/
- if ((ia_valid & ATTR_UID && attr->ia_uid != ADFS_SB(sb)->s_uid) ||
- (ia_valid & ATTR_GID && attr->ia_gid != ADFS_SB(sb)->s_gid))
+ if ((ia_valid & ATTR_UID && !uid_eq(attr->ia_uid, ADFS_SB(sb)->s_uid)) ||
+ (ia_valid & ATTR_GID && !gid_eq(attr->ia_gid, ADFS_SB(sb)->s_gid)))
error = -EPERM;
if (error)
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index bdaec92..22a0d7e 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -15,6 +15,7 @@
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/statfs.h>
+#include <linux/user_namespace.h>
#include "adfs.h"
#include "dir_f.h"
#include "dir_fplus.h"
@@ -130,10 +131,10 @@ static int adfs_show_options(struct seq_file *seq, struct dentry *root)
{
struct adfs_sb_info *asb = ADFS_SB(root->d_sb);
- if (asb->s_uid != 0)
- seq_printf(seq, ",uid=%u", asb->s_uid);
- if (asb->s_gid != 0)
- seq_printf(seq, ",gid=%u", asb->s_gid);
+ if (!uid_eq(asb->s_uid, GLOBAL_ROOT_UID))
+ seq_printf(seq, ",uid=%u", from_kuid_munged(&init_user_ns, asb->s_uid));
+ if (!gid_eq(asb->s_gid, GLOBAL_ROOT_GID))
+ seq_printf(seq, ",gid=%u", from_kgid_munged(&init_user_ns, asb->s_gid));
if (asb->s_owner_mask != ADFS_DEFAULT_OWNER_MASK)
seq_printf(seq, ",ownmask=%o", asb->s_owner_mask);
if (asb->s_other_mask != ADFS_DEFAULT_OTHER_MASK)
@@ -175,12 +176,16 @@ static int parse_options(struct super_block *sb, char *options)
case Opt_uid:
if (match_int(args, &option))
return -EINVAL;
- asb->s_uid = option;
+ asb->s_uid = make_kuid(current_user_ns(), option);
+ if (!uid_valid(asb->s_uid))
+ return -EINVAL;
break;
case Opt_gid:
if (match_int(args, &option))
return -EINVAL;
- asb->s_gid = option;
+ asb->s_gid = make_kgid(current_user_ns(), option);
+ if (!gid_valid(asb->s_gid))
+ return -EINVAL;
break;
case Opt_ownmask:
if (match_octal(args, &option))
@@ -369,8 +374,8 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
sb->s_fs_info = asb;
/* set default options */
- asb->s_uid = 0;
- asb->s_gid = 0;
+ asb->s_uid = GLOBAL_ROOT_UID;
+ asb->s_gid = GLOBAL_ROOT_GID;
asb->s_owner_mask = ADFS_DEFAULT_OWNER_MASK;
asb->s_other_mask = ADFS_DEFAULT_OTHER_MASK;
asb->s_ftsuffix = 0;
diff --git a/init/Kconfig b/init/Kconfig
index 485c60a..20ddf0d 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -933,7 +933,6 @@ config UIDGID_CONVERTED
# Filesystems
depends on 9P_FS = n
- depends on ADFS_FS = n
depends on AFFS_FS = n
depends on AFS_FS = n
depends on AUTOFS4_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 08/25] userns: Convert befs to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (5 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 07/25] userns: Convert adfs " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 11:41 ` [PATCH 09/25] userns: Convert cramfs " Eric W. Biederman
` (13 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/befs/befs.h | 4 ++--
fs/befs/linuxvfs.c | 27 +++++++++++++++++++--------
init/Kconfig | 1 -
3 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/fs/befs/befs.h b/fs/befs/befs.h
index d9a40ab..b266428 100644
--- a/fs/befs/befs.h
+++ b/fs/befs/befs.h
@@ -20,8 +20,8 @@ typedef u64 befs_blocknr_t;
*/
typedef struct befs_mount_options {
- gid_t gid;
- uid_t uid;
+ kgid_t gid;
+ kuid_t uid;
int use_gid;
int use_uid;
int debug;
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index cf7f3c6..7f73a69 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -15,6 +15,7 @@
#include <linux/vfs.h>
#include <linux/parser.h>
#include <linux/namei.h>
+#include <linux/sched.h>
#include "befs.h"
#include "btree.h"
@@ -352,9 +353,11 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
*/
inode->i_uid = befs_sb->mount_opts.use_uid ?
- befs_sb->mount_opts.uid : (uid_t) fs32_to_cpu(sb, raw_inode->uid);
+ befs_sb->mount_opts.uid :
+ make_kuid(&init_user_ns, fs32_to_cpu(sb, raw_inode->uid));
inode->i_gid = befs_sb->mount_opts.use_gid ?
- befs_sb->mount_opts.gid : (gid_t) fs32_to_cpu(sb, raw_inode->gid);
+ befs_sb->mount_opts.gid :
+ make_kgid(&init_user_ns, fs32_to_cpu(sb, raw_inode->gid));
set_nlink(inode, 1);
@@ -674,10 +677,12 @@ parse_options(char *options, befs_mount_options * opts)
char *p;
substring_t args[MAX_OPT_ARGS];
int option;
+ kuid_t uid;
+ kgid_t gid;
/* Initialize options */
- opts->uid = 0;
- opts->gid = 0;
+ opts->uid = GLOBAL_ROOT_UID;
+ opts->gid = GLOBAL_ROOT_GID;
opts->use_uid = 0;
opts->use_gid = 0;
opts->iocharset = NULL;
@@ -696,23 +701,29 @@ parse_options(char *options, befs_mount_options * opts)
case Opt_uid:
if (match_int(&args[0], &option))
return 0;
- if (option < 0) {
+ uid = INVALID_UID;
+ if (option >= 0)
+ uid = make_kuid(current_user_ns(), option);
+ if (!uid_valid(uid)) {
printk(KERN_ERR "BeFS: Invalid uid %d, "
"using default\n", option);
break;
}
- opts->uid = option;
+ opts->uid = uid;
opts->use_uid = 1;
break;
case Opt_gid:
if (match_int(&args[0], &option))
return 0;
- if (option < 0) {
+ gid = INVALID_GID;
+ if (option >= 0)
+ gid = make_kgid(current_user_ns(), option);
+ if (!gid_valid(gid)) {
printk(KERN_ERR "BeFS: Invalid gid %d, "
"using default\n", option);
break;
}
- opts->gid = option;
+ opts->gid = gid;
opts->use_gid = 1;
break;
case Opt_charset:
diff --git a/init/Kconfig b/init/Kconfig
index 20ddf0d..d9bb344 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -936,7 +936,6 @@ config UIDGID_CONVERTED
depends on AFFS_FS = n
depends on AFS_FS = n
depends on AUTOFS4_FS = n
- depends on BEFS_FS = n
depends on BFS_FS = n
depends on BTRFS_FS = n
depends on CEPH_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 09/25] userns: Convert cramfs to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (6 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 08/25] userns: Convert befs to use kuid/kgid " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 11:41 ` [PATCH 10/25] userns: Convert ecryptfs " Eric W. Biederman
` (12 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/cramfs/inode.c | 4 ++--
init/Kconfig | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 28cca01..c6c3f91 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -90,8 +90,8 @@ static struct inode *get_cramfs_inode(struct super_block *sb,
}
inode->i_mode = cramfs_inode->mode;
- inode->i_uid = cramfs_inode->uid;
- inode->i_gid = cramfs_inode->gid;
+ i_uid_write(inode, cramfs_inode->uid);
+ i_gid_write(inode, cramfs_inode->gid);
/* if the lower 2 bits are zero, the inode contains data */
if (!(inode->i_ino & 3)) {
diff --git a/init/Kconfig b/init/Kconfig
index d9bb344..5f846b5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -941,7 +941,6 @@ config UIDGID_CONVERTED
depends on CEPH_FS = n
depends on CIFS = n
depends on CODA_FS = n
- depends on CRAMFS = n
depends on ECRYPT_FS = n
depends on EFS_FS = n
depends on EXOFS_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 10/25] userns: Convert ecryptfs to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (7 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 09/25] userns: Convert cramfs " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 11:41 ` [PATCH 11/25] userns: Convert efs " Eric W. Biederman
` (11 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
Tyler Hicks, Dustin Kirkland, Eric W. Biederman
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Tyler Hicks <tyhicks-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Cc: Dustin Kirkland <dustin.kirkland-Bv2LyzZ6GzxBDgjK7y7TUQ@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/ecryptfs/main.c | 5 +++--
fs/ecryptfs/messaging.c | 5 ++---
init/Kconfig | 1 -
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 2768138..1d6ce91 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -544,11 +544,12 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags
goto out_free;
}
- if (check_ruid && path.dentry->d_inode->i_uid != current_uid()) {
+ if (check_ruid && !uid_eq(path.dentry->d_inode->i_uid, current_uid())) {
rc = -EPERM;
printk(KERN_ERR "Mount of device (uid: %d) not owned by "
"requested user (uid: %d)\n",
- path.dentry->d_inode->i_uid, current_uid());
+ i_uid_read(path.dentry->d_inode),
+ from_kuid(&init_user_ns, current_uid()));
goto out_free;
}
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c
index b29bb8b..5fa2471 100644
--- a/fs/ecryptfs/messaging.c
+++ b/fs/ecryptfs/messaging.c
@@ -33,7 +33,7 @@ static struct hlist_head *ecryptfs_daemon_hash;
struct mutex ecryptfs_daemon_hash_mux;
static int ecryptfs_hash_bits;
#define ecryptfs_current_euid_hash(uid) \
- hash_long((unsigned long)current_euid(), ecryptfs_hash_bits)
+ hash_long((unsigned long)from_kuid(&init_user_ns, current_euid()), ecryptfs_hash_bits)
static u32 ecryptfs_msg_counter;
static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;
@@ -121,8 +121,7 @@ int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon)
hlist_for_each_entry(*daemon, elem,
&ecryptfs_daemon_hash[ecryptfs_current_euid_hash()],
euid_chain) {
- if ((*daemon)->file->f_cred->euid == current_euid() &&
- (*daemon)->file->f_cred->user_ns == current_user_ns()) {
+ if (uid_eq((*daemon)->file->f_cred->euid, current_euid())) {
rc = 0;
goto out;
}
diff --git a/init/Kconfig b/init/Kconfig
index 5f846b5..6120bae 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -941,7 +941,6 @@ config UIDGID_CONVERTED
depends on CEPH_FS = n
depends on CIFS = n
depends on CODA_FS = n
- depends on ECRYPT_FS = n
depends on EFS_FS = n
depends on EXOFS_FS = n
depends on FUSE_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 11/25] userns: Convert efs to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (8 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 10/25] userns: Convert ecryptfs " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 11:41 ` [PATCH 12/25] userns: Convert exofs " Eric W. Biederman
` (10 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/efs/inode.c | 4 ++--
init/Kconfig | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/efs/inode.c b/fs/efs/inode.c
index bc84f36..f3913eb 100644
--- a/fs/efs/inode.c
+++ b/fs/efs/inode.c
@@ -97,8 +97,8 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino)
inode->i_mode = be16_to_cpu(efs_inode->di_mode);
set_nlink(inode, be16_to_cpu(efs_inode->di_nlink));
- inode->i_uid = (uid_t)be16_to_cpu(efs_inode->di_uid);
- inode->i_gid = (gid_t)be16_to_cpu(efs_inode->di_gid);
+ i_uid_write(inode, (uid_t)be16_to_cpu(efs_inode->di_uid));
+ i_gid_write(inode, (gid_t)be16_to_cpu(efs_inode->di_gid));
inode->i_size = be32_to_cpu(efs_inode->di_size);
inode->i_atime.tv_sec = be32_to_cpu(efs_inode->di_atime);
inode->i_mtime.tv_sec = be32_to_cpu(efs_inode->di_mtime);
diff --git a/init/Kconfig b/init/Kconfig
index 6120bae..51084b0 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -941,7 +941,6 @@ config UIDGID_CONVERTED
depends on CEPH_FS = n
depends on CIFS = n
depends on CODA_FS = n
- depends on EFS_FS = n
depends on EXOFS_FS = n
depends on FUSE_FS = n
depends on GFS2_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 12/25] userns: Convert exofs to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (9 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 11/25] userns: Convert efs " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 12:20 ` Boaz Harrosh
2012-09-20 11:41 ` [PATCH 13/25] userns: Convert hfs to use kuid and kgid " Eric W. Biederman
` (9 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
Benny Halevy, Eric W. Biederman, Boaz Harrosh
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
Cc: Benny Halevy <bhalevy-4/WYdZTkCtzQT0dZR+AlfA@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/exofs/inode.c | 8 ++++----
init/Kconfig | 1 -
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c
index 5badb0c..190c3d6 100644
--- a/fs/exofs/inode.c
+++ b/fs/exofs/inode.c
@@ -1163,8 +1163,8 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino)
/* copy stuff from on-disk struct to in-memory struct */
inode->i_mode = le16_to_cpu(fcb.i_mode);
- inode->i_uid = le32_to_cpu(fcb.i_uid);
- inode->i_gid = le32_to_cpu(fcb.i_gid);
+ i_uid_write(inode, le32_to_cpu(fcb.i_uid));
+ i_gid_write(inode, le32_to_cpu(fcb.i_gid));
set_nlink(inode, le16_to_cpu(fcb.i_links_count));
inode->i_ctime.tv_sec = (signed)le32_to_cpu(fcb.i_ctime);
inode->i_atime.tv_sec = (signed)le32_to_cpu(fcb.i_atime);
@@ -1376,8 +1376,8 @@ static int exofs_update_inode(struct inode *inode, int do_sync)
fcb = &args->fcb;
fcb->i_mode = cpu_to_le16(inode->i_mode);
- fcb->i_uid = cpu_to_le32(inode->i_uid);
- fcb->i_gid = cpu_to_le32(inode->i_gid);
+ fcb->i_uid = cpu_to_le32(i_uid_read(inode));
+ fcb->i_gid = cpu_to_le32(i_gid_read(inode));
fcb->i_links_count = cpu_to_le16(inode->i_nlink);
fcb->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec);
fcb->i_atime = cpu_to_le32(inode->i_atime.tv_sec);
diff --git a/init/Kconfig b/init/Kconfig
index 51084b0..39e55d6 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -941,7 +941,6 @@ config UIDGID_CONVERTED
depends on CEPH_FS = n
depends on CIFS = n
depends on CODA_FS = n
- depends on EXOFS_FS = n
depends on FUSE_FS = n
depends on GFS2_FS = n
depends on HFS_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 12/25] userns: Convert exofs to use kuid/kgid where appropriate
2012-09-20 11:41 ` [PATCH 12/25] userns: Convert exofs " Eric W. Biederman
@ 2012-09-20 12:20 ` Boaz Harrosh
0 siblings, 0 replies; 41+ messages in thread
From: Boaz Harrosh @ 2012-09-20 12:20 UTC (permalink / raw)
To: Eric W. Biederman
Cc: linux-fsdevel, linux-kernel, Serge Hallyn, Linux Containers,
Benny Halevy
On 09/20/2012 02:41 PM, Eric W. Biederman wrote:
> From: "Eric W. Biederman" <ebiederm@xmission.com>
>
> Cc: Boaz Harrosh <bharrosh@panasas.com>
> Cc: Benny Halevy <bhalevy@tonian.com>
> Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Acked-by: Boaz Harrosh <bharrosh@panasas.com>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> ---
> fs/exofs/inode.c | 8 ++++----
> init/Kconfig | 1 -
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c
> index 5badb0c..190c3d6 100644
> --- a/fs/exofs/inode.c
> +++ b/fs/exofs/inode.c
> @@ -1163,8 +1163,8 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino)
>
> /* copy stuff from on-disk struct to in-memory struct */
> inode->i_mode = le16_to_cpu(fcb.i_mode);
> - inode->i_uid = le32_to_cpu(fcb.i_uid);
> - inode->i_gid = le32_to_cpu(fcb.i_gid);
> + i_uid_write(inode, le32_to_cpu(fcb.i_uid));
> + i_gid_write(inode, le32_to_cpu(fcb.i_gid));
> set_nlink(inode, le16_to_cpu(fcb.i_links_count));
> inode->i_ctime.tv_sec = (signed)le32_to_cpu(fcb.i_ctime);
> inode->i_atime.tv_sec = (signed)le32_to_cpu(fcb.i_atime);
> @@ -1376,8 +1376,8 @@ static int exofs_update_inode(struct inode *inode, int do_sync)
> fcb = &args->fcb;
>
> fcb->i_mode = cpu_to_le16(inode->i_mode);
> - fcb->i_uid = cpu_to_le32(inode->i_uid);
> - fcb->i_gid = cpu_to_le32(inode->i_gid);
> + fcb->i_uid = cpu_to_le32(i_uid_read(inode));
> + fcb->i_gid = cpu_to_le32(i_gid_read(inode));
> fcb->i_links_count = cpu_to_le16(inode->i_nlink);
> fcb->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec);
> fcb->i_atime = cpu_to_le32(inode->i_atime.tv_sec);
> diff --git a/init/Kconfig b/init/Kconfig
> index 51084b0..39e55d6 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -941,7 +941,6 @@ config UIDGID_CONVERTED
> depends on CEPH_FS = n
> depends on CIFS = n
> depends on CODA_FS = n
> - depends on EXOFS_FS = n
> depends on FUSE_FS = n
> depends on GFS2_FS = n
> depends on HFS_FS = n
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 13/25] userns: Convert hfs to use kuid and kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (10 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 12/25] userns: Convert exofs " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 11:41 ` [PATCH 14/25] userns: Convert hfsplus " Eric W. Biederman
` (8 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/hfs/hfs_fs.h | 4 ++--
fs/hfs/inode.c | 4 ++--
fs/hfs/super.c | 16 +++++++++++++---
init/Kconfig | 1 -
4 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h
index 8275175..693df9f 100644
--- a/fs/hfs/hfs_fs.h
+++ b/fs/hfs/hfs_fs.h
@@ -134,8 +134,8 @@ struct hfs_sb_info {
permissions on all files */
umode_t s_dir_umask; /* The umask applied to the
permissions on all dirs */
- uid_t s_uid; /* The uid of all files */
- gid_t s_gid; /* The gid of all files */
+ kuid_t s_uid; /* The uid of all files */
+ kgid_t s_gid; /* The gid of all files */
int session, part;
struct nls_table *nls_io, *nls_disk;
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index ee1bc55..5d5c22d 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -594,9 +594,9 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr)
/* no uig/gid changes and limit which mode bits can be set */
if (((attr->ia_valid & ATTR_UID) &&
- (attr->ia_uid != hsb->s_uid)) ||
+ (!uid_eq(attr->ia_uid, hsb->s_uid))) ||
((attr->ia_valid & ATTR_GID) &&
- (attr->ia_gid != hsb->s_gid)) ||
+ (!gid_eq(attr->ia_gid, hsb->s_gid))) ||
((attr->ia_valid & ATTR_MODE) &&
((S_ISDIR(inode->i_mode) &&
(attr->ia_mode != inode->i_mode)) ||
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 4eb873e..0b63d13 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -138,7 +138,9 @@ static int hfs_show_options(struct seq_file *seq, struct dentry *root)
seq_printf(seq, ",creator=%.4s", (char *)&sbi->s_creator);
if (sbi->s_type != cpu_to_be32(0x3f3f3f3f))
seq_printf(seq, ",type=%.4s", (char *)&sbi->s_type);
- seq_printf(seq, ",uid=%u,gid=%u", sbi->s_uid, sbi->s_gid);
+ seq_printf(seq, ",uid=%u,gid=%u",
+ from_kuid_munged(&init_user_ns, sbi->s_uid),
+ from_kgid_munged(&init_user_ns, sbi->s_gid));
if (sbi->s_file_umask != 0133)
seq_printf(seq, ",file_umask=%o", sbi->s_file_umask);
if (sbi->s_dir_umask != 0022)
@@ -254,14 +256,22 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
printk(KERN_ERR "hfs: uid requires an argument\n");
return 0;
}
- hsb->s_uid = (uid_t)tmp;
+ hsb->s_uid = make_kuid(current_user_ns(), (uid_t)tmp);
+ if (!uid_valid(hsb->s_uid)) {
+ printk(KERN_ERR "hfs: invalid uid %d\n", tmp);
+ return 0;
+ }
break;
case opt_gid:
if (match_int(&args[0], &tmp)) {
printk(KERN_ERR "hfs: gid requires an argument\n");
return 0;
}
- hsb->s_gid = (gid_t)tmp;
+ hsb->s_gid = make_kgid(current_user_ns(), (gid_t)tmp);
+ if (!gid_valid(hsb->s_gid)) {
+ printk(KERN_ERR "hfs: invalid gid %d\n", tmp);
+ return 0;
+ }
break;
case opt_umask:
if (match_octal(&args[0], &tmp)) {
diff --git a/init/Kconfig b/init/Kconfig
index 39e55d6..6038d64 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -943,7 +943,6 @@ config UIDGID_CONVERTED
depends on CODA_FS = n
depends on FUSE_FS = n
depends on GFS2_FS = n
- depends on HFS_FS = n
depends on HFSPLUS_FS = n
depends on HPFS_FS = n
depends on ISO9660_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 14/25] userns: Convert hfsplus to use kuid and kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (11 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 13/25] userns: Convert hfs to use kuid and kgid " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 11:41 ` [PATCH 15/25] userns: Convert isofs to use kuid/kgid " Eric W. Biederman
` (7 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/hfsplus/catalog.c | 4 ++--
fs/hfsplus/hfsplus_fs.h | 4 ++--
fs/hfsplus/inode.c | 8 ++++----
fs/hfsplus/options.c | 15 ++++++++++++---
init/Kconfig | 1 -
5 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c
index ec2a9c2..798d9c4 100644
--- a/fs/hfsplus/catalog.c
+++ b/fs/hfsplus/catalog.c
@@ -80,8 +80,8 @@ void hfsplus_cat_set_perms(struct inode *inode, struct hfsplus_perm *perms)
perms->userflags = HFSPLUS_I(inode)->userflags;
perms->mode = cpu_to_be16(inode->i_mode);
- perms->owner = cpu_to_be32(inode->i_uid);
- perms->group = cpu_to_be32(inode->i_gid);
+ perms->owner = cpu_to_be32(i_uid_read(inode));
+ perms->group = cpu_to_be32(i_gid_read(inode));
if (S_ISREG(inode->i_mode))
perms->dev = cpu_to_be32(inode->i_nlink);
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
index 558dbb4..c571de2 100644
--- a/fs/hfsplus/hfsplus_fs.h
+++ b/fs/hfsplus/hfsplus_fs.h
@@ -149,8 +149,8 @@ struct hfsplus_sb_info {
u32 type;
umode_t umask;
- uid_t uid;
- gid_t gid;
+ kuid_t uid;
+ kgid_t gid;
int part, session;
unsigned long flags;
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 3d8b4a6..2172aa5 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -233,12 +233,12 @@ static void hfsplus_get_perms(struct inode *inode,
mode = be16_to_cpu(perms->mode);
- inode->i_uid = be32_to_cpu(perms->owner);
- if (!inode->i_uid && !mode)
+ i_uid_write(inode, be32_to_cpu(perms->owner));
+ if (!i_uid_read(inode) && !mode)
inode->i_uid = sbi->uid;
- inode->i_gid = be32_to_cpu(perms->group);
- if (!inode->i_gid && !mode)
+ i_gid_write(inode, be32_to_cpu(perms->group));
+ if (!i_gid_read(inode) && !mode)
inode->i_gid = sbi->gid;
if (dir) {
diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c
index 06fa561..ed257c6 100644
--- a/fs/hfsplus/options.c
+++ b/fs/hfsplus/options.c
@@ -135,14 +135,22 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi)
printk(KERN_ERR "hfs: uid requires an argument\n");
return 0;
}
- sbi->uid = (uid_t)tmp;
+ sbi->uid = make_kuid(current_user_ns(), (uid_t)tmp);
+ if (!uid_valid(sbi->uid)) {
+ printk(KERN_ERR "hfs: invalid uid specified\n");
+ return 0;
+ }
break;
case opt_gid:
if (match_int(&args[0], &tmp)) {
printk(KERN_ERR "hfs: gid requires an argument\n");
return 0;
}
- sbi->gid = (gid_t)tmp;
+ sbi->gid = make_kgid(current_user_ns(), (gid_t)tmp);
+ if (!gid_valid(sbi->gid)) {
+ printk(KERN_ERR "hfs: invalid gid specified\n");
+ return 0;
+ }
break;
case opt_part:
if (match_int(&args[0], &sbi->part)) {
@@ -215,7 +223,8 @@ int hfsplus_show_options(struct seq_file *seq, struct dentry *root)
if (sbi->type != HFSPLUS_DEF_CR_TYPE)
seq_printf(seq, ",type=%.4s", (char *)&sbi->type);
seq_printf(seq, ",umask=%o,uid=%u,gid=%u", sbi->umask,
- sbi->uid, sbi->gid);
+ from_kuid_munged(&init_user_ns, sbi->uid),
+ from_kgid_munged(&init_user_ns, sbi->gid));
if (sbi->part >= 0)
seq_printf(seq, ",part=%u", sbi->part);
if (sbi->session >= 0)
diff --git a/init/Kconfig b/init/Kconfig
index 6038d64..9cf8cb1 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -943,7 +943,6 @@ config UIDGID_CONVERTED
depends on CODA_FS = n
depends on FUSE_FS = n
depends on GFS2_FS = n
- depends on HFSPLUS_FS = n
depends on HPFS_FS = n
depends on ISO9660_FS = n
depends on JFFS2_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 15/25] userns: Convert isofs to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (12 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 14/25] userns: Convert hfsplus " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 11:41 ` [PATCH 18/25] userns: Convert nillfs2 " Eric W. Biederman
` (6 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/isofs/inode.c | 17 +++++++++++------
fs/isofs/isofs.h | 4 ++--
fs/isofs/rock.c | 4 ++--
init/Kconfig | 1 -
4 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 29037c3..a7d8e6c 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -21,6 +21,7 @@
#include <linux/cdrom.h>
#include <linux/parser.h>
#include <linux/mpage.h>
+#include <linux/user_namespace.h>
#include "isofs.h"
#include "zisofs.h"
@@ -171,8 +172,8 @@ struct iso9660_options{
unsigned int blocksize;
umode_t fmode;
umode_t dmode;
- gid_t gid;
- uid_t uid;
+ kgid_t gid;
+ kuid_t uid;
char *iocharset;
/* LVE */
s32 session;
@@ -383,8 +384,8 @@ static int parse_options(char *options, struct iso9660_options *popt)
popt->fmode = popt->dmode = ISOFS_INVALID_MODE;
popt->uid_set = 0;
popt->gid_set = 0;
- popt->gid = 0;
- popt->uid = 0;
+ popt->gid = GLOBAL_ROOT_GID;
+ popt->uid = GLOBAL_ROOT_UID;
popt->iocharset = NULL;
popt->utf8 = 0;
popt->overriderockperm = 0;
@@ -460,13 +461,17 @@ static int parse_options(char *options, struct iso9660_options *popt)
case Opt_uid:
if (match_int(&args[0], &option))
return 0;
- popt->uid = option;
+ popt->uid = make_kuid(current_user_ns(), option);
+ if (!uid_valid(popt->uid))
+ return 0;
popt->uid_set = 1;
break;
case Opt_gid:
if (match_int(&args[0], &option))
return 0;
- popt->gid = option;
+ popt->gid = make_kgid(current_user_ns(), option);
+ if (!gid_valid(popt->gid))
+ return 0;
popt->gid_set = 1;
break;
case Opt_mode:
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h
index 3620ad1..9916723 100644
--- a/fs/isofs/isofs.h
+++ b/fs/isofs/isofs.h
@@ -52,8 +52,8 @@ struct isofs_sb_info {
umode_t s_fmode;
umode_t s_dmode;
- gid_t s_gid;
- uid_t s_uid;
+ kgid_t s_gid;
+ kuid_t s_uid;
struct nls_table *s_nls_iocharset; /* Native language support table */
};
diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c
index 70e79d0..c0bf424 100644
--- a/fs/isofs/rock.c
+++ b/fs/isofs/rock.c
@@ -364,8 +364,8 @@ repeat:
case SIG('P', 'X'):
inode->i_mode = isonum_733(rr->u.PX.mode);
set_nlink(inode, isonum_733(rr->u.PX.n_links));
- inode->i_uid = isonum_733(rr->u.PX.uid);
- inode->i_gid = isonum_733(rr->u.PX.gid);
+ i_uid_write(inode, isonum_733(rr->u.PX.uid));
+ i_gid_write(inode, isonum_733(rr->u.PX.gid));
break;
case SIG('P', 'N'):
{
diff --git a/init/Kconfig b/init/Kconfig
index 9cf8cb1..88f6571 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -944,7 +944,6 @@ config UIDGID_CONVERTED
depends on FUSE_FS = n
depends on GFS2_FS = n
depends on HPFS_FS = n
- depends on ISO9660_FS = n
depends on JFFS2_FS = n
depends on JFS_FS = n
depends on LOGFS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 18/25] userns: Convert nillfs2 to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (13 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 15/25] userns: Convert isofs to use kuid/kgid " Eric W. Biederman
@ 2012-09-20 11:41 ` Eric W. Biederman
2012-09-20 14:34 ` Ryusuke Konishi
2012-09-20 11:42 ` [PATCH 19/25] userns: Convert ntfs to use kuid and kgid " Eric W. Biederman
` (5 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:41 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman, KONISHI Ryusuke,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: KONISHI Ryusuke <konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/nilfs2/inode.c | 8 ++++----
init/Kconfig | 1 -
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index 6e2c3db..4d31d2c 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -401,8 +401,8 @@ int nilfs_read_inode_common(struct inode *inode,
int err;
inode->i_mode = le16_to_cpu(raw_inode->i_mode);
- inode->i_uid = (uid_t)le32_to_cpu(raw_inode->i_uid);
- inode->i_gid = (gid_t)le32_to_cpu(raw_inode->i_gid);
+ i_uid_write(inode, le32_to_cpu(raw_inode->i_uid));
+ i_gid_write(inode, le32_to_cpu(raw_inode->i_gid));
set_nlink(inode, le16_to_cpu(raw_inode->i_links_count));
inode->i_size = le64_to_cpu(raw_inode->i_size);
inode->i_atime.tv_sec = le64_to_cpu(raw_inode->i_mtime);
@@ -590,8 +590,8 @@ void nilfs_write_inode_common(struct inode *inode,
struct nilfs_inode_info *ii = NILFS_I(inode);
raw_inode->i_mode = cpu_to_le16(inode->i_mode);
- raw_inode->i_uid = cpu_to_le32(inode->i_uid);
- raw_inode->i_gid = cpu_to_le32(inode->i_gid);
+ raw_inode->i_uid = cpu_to_le32(i_uid_read(inode));
+ raw_inode->i_gid = cpu_to_le32(i_gid_read(inode));
raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
raw_inode->i_size = cpu_to_le64(inode->i_size);
raw_inode->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec);
diff --git a/init/Kconfig b/init/Kconfig
index c69e085..90c9e06 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -949,7 +949,6 @@ config UIDGID_CONVERTED
depends on NCP_FS = n
depends on NFSD = n
depends on NFS_FS = n
- depends on NILFS2_FS = n
depends on NTFS_FS = n
depends on OCFS2_FS = n
depends on OMFS_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 18/25] userns: Convert nillfs2 to use kuid/kgid where appropriate
2012-09-20 11:41 ` [PATCH 18/25] userns: Convert nillfs2 " Eric W. Biederman
@ 2012-09-20 14:34 ` Ryusuke Konishi
0 siblings, 0 replies; 41+ messages in thread
From: Ryusuke Konishi @ 2012-09-20 14:34 UTC (permalink / raw)
To: Eric W. Biederman
Cc: linux-fsdevel, linux-kernel, Serge Hallyn, Linux Containers
On Thu, 20 Sep 2012 04:41:59 -0700, "Eric W. Biederman" wrote:
> From: "Eric W. Biederman" <ebiederm@xmission.com>
>
> Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
> Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> ---
> fs/nilfs2/inode.c | 8 ++++----
> init/Kconfig | 1 -
> 2 files changed, 4 insertions(+), 5 deletions(-)
Looks good to me, thanks.
Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Ryusuke Konishi
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 19/25] userns: Convert ntfs to use kuid and kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (14 preceding siblings ...)
2012-09-20 11:41 ` [PATCH 18/25] userns: Convert nillfs2 " Eric W. Biederman
@ 2012-09-20 11:42 ` Eric W. Biederman
2012-09-20 11:42 ` [PATCH 20/25] userns: Convert omfs " Eric W. Biederman
` (4 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:42 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Anton Altaparmakov
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Anton Altaparmakov <anton-yrGDUoBaLx3QT0dZR+AlfA@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/ntfs/inode.c | 7 ++++---
fs/ntfs/super.c | 39 ++++++++++++++++++++++++++++++++-------
fs/ntfs/volume.h | 5 +++--
init/Kconfig | 1 -
4 files changed, 39 insertions(+), 13 deletions(-)
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index c6dbd3d..1d27331 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -2124,7 +2124,8 @@ int ntfs_read_inode_mount(struct inode *vi)
* ntfs_read_inode() will have set up the default ones.
*/
/* Set uid and gid to root. */
- vi->i_uid = vi->i_gid = 0;
+ vi->i_uid = GLOBAL_ROOT_UID;
+ vi->i_gid = GLOBAL_ROOT_GID;
/* Regular file. No access for anyone. */
vi->i_mode = S_IFREG;
/* No VFS initiated operations allowed for $MFT. */
@@ -2312,8 +2313,8 @@ int ntfs_show_options(struct seq_file *sf, struct dentry *root)
ntfs_volume *vol = NTFS_SB(root->d_sb);
int i;
- seq_printf(sf, ",uid=%i", vol->uid);
- seq_printf(sf, ",gid=%i", vol->gid);
+ seq_printf(sf, ",uid=%i", from_kuid_munged(&init_user_ns, vol->uid));
+ seq_printf(sf, ",gid=%i", from_kgid_munged(&init_user_ns, vol->gid));
if (vol->fmask == vol->dmask)
seq_printf(sf, ",umask=0%o", vol->fmask);
else {
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 2bc149d..da01c16 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -102,8 +102,8 @@ static bool parse_options(ntfs_volume *vol, char *opt)
char *p, *v, *ov;
static char *utf8 = "utf8";
int errors = 0, sloppy = 0;
- uid_t uid = (uid_t)-1;
- gid_t gid = (gid_t)-1;
+ kuid_t uid = INVALID_UID;
+ kgid_t gid = INVALID_GID;
umode_t fmask = (umode_t)-1, dmask = (umode_t)-1;
int mft_zone_multiplier = -1, on_errors = -1;
int show_sys_files = -1, case_sensitive = -1, disable_sparse = -1;
@@ -128,6 +128,30 @@ static bool parse_options(ntfs_volume *vol, char *opt)
if (*v) \
goto needs_val; \
}
+#define NTFS_GETOPT_UID(option, variable) \
+ if (!strcmp(p, option)) { \
+ uid_t uid_value; \
+ if (!v || !*v) \
+ goto needs_arg; \
+ uid_value = simple_strtoul(ov = v, &v, 0); \
+ if (*v) \
+ goto needs_val; \
+ variable = make_kuid(current_user_ns(), uid_value); \
+ if (!uid_valid(variable)) \
+ goto needs_val; \
+ }
+#define NTFS_GETOPT_GID(option, variable) \
+ if (!strcmp(p, option)) { \
+ gid_t gid_value; \
+ if (!v || !*v) \
+ goto needs_arg; \
+ gid_value = simple_strtoul(ov = v, &v, 0); \
+ if (*v) \
+ goto needs_val; \
+ variable = make_kgid(current_user_ns(), gid_value); \
+ if (!gid_valid(variable)) \
+ goto needs_val; \
+ }
#define NTFS_GETOPT_OCTAL(option, variable) \
if (!strcmp(p, option)) { \
if (!v || !*v) \
@@ -165,8 +189,8 @@ static bool parse_options(ntfs_volume *vol, char *opt)
while ((p = strsep(&opt, ","))) {
if ((v = strchr(p, '=')))
*v++ = 0;
- NTFS_GETOPT("uid", uid)
- else NTFS_GETOPT("gid", gid)
+ NTFS_GETOPT_UID("uid", uid)
+ else NTFS_GETOPT_GID("gid", gid)
else NTFS_GETOPT_OCTAL("umask", fmask = dmask)
else NTFS_GETOPT_OCTAL("fmask", fmask)
else NTFS_GETOPT_OCTAL("dmask", dmask)
@@ -283,9 +307,9 @@ no_mount_options:
vol->on_errors = on_errors;
if (!vol->on_errors || vol->on_errors == ON_ERRORS_RECOVER)
vol->on_errors |= ON_ERRORS_CONTINUE;
- if (uid != (uid_t)-1)
+ if (uid_valid(uid))
vol->uid = uid;
- if (gid != (gid_t)-1)
+ if (gid_valid(gid))
vol->gid = gid;
if (fmask != (umode_t)-1)
vol->fmask = fmask;
@@ -1023,7 +1047,8 @@ static bool load_and_init_mft_mirror(ntfs_volume *vol)
* ntfs_read_inode() will have set up the default ones.
*/
/* Set uid and gid to root. */
- tmp_ino->i_uid = tmp_ino->i_gid = 0;
+ tmp_ino->i_uid = GLOBAL_ROOT_UID;
+ tmp_ino->i_gid = GLOBAL_ROOT_GID;
/* Regular file. No access for anyone. */
tmp_ino->i_mode = S_IFREG;
/* No VFS initiated operations allowed for $MFTMirr. */
diff --git a/fs/ntfs/volume.h b/fs/ntfs/volume.h
index 15e3ba8..4f579b0 100644
--- a/fs/ntfs/volume.h
+++ b/fs/ntfs/volume.h
@@ -25,6 +25,7 @@
#define _LINUX_NTFS_VOLUME_H
#include <linux/rwsem.h>
+#include <linux/uidgid.h>
#include "types.h"
#include "layout.h"
@@ -46,8 +47,8 @@ typedef struct {
sized blocks on the device. */
/* Configuration provided by user at mount time. */
unsigned long flags; /* Miscellaneous flags, see below. */
- uid_t uid; /* uid that files will be mounted as. */
- gid_t gid; /* gid that files will be mounted as. */
+ kuid_t uid; /* uid that files will be mounted as. */
+ kgid_t gid; /* gid that files will be mounted as. */
umode_t fmask; /* The mask for file permissions. */
umode_t dmask; /* The mask for directory
permissions. */
diff --git a/init/Kconfig b/init/Kconfig
index 90c9e06..0f65a02 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -949,7 +949,6 @@ config UIDGID_CONVERTED
depends on NCP_FS = n
depends on NFSD = n
depends on NFS_FS = n
- depends on NTFS_FS = n
depends on OCFS2_FS = n
depends on OMFS_FS = n
depends on QNX4FS_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 20/25] userns: Convert omfs to use kuid and kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (15 preceding siblings ...)
2012-09-20 11:42 ` [PATCH 19/25] userns: Convert ntfs to use kuid and kgid " Eric W. Biederman
@ 2012-09-20 11:42 ` Eric W. Biederman
[not found] ` <1348141326-23355-20-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-20 11:42 ` [PATCH 22/25] userns: Convert the qnx6 filesystem to use kuid/kgid " Eric W. Biederman
` (3 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:42 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman, Bob Copeland,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Bob Copeland <me-aXfl/3sk2vNUbtYUoyoikg@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/omfs/inode.c | 8 ++++++--
fs/omfs/omfs.h | 4 ++--
init/Kconfig | 1 -
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c
index e6213b3..25d715c 100644
--- a/fs/omfs/inode.c
+++ b/fs/omfs/inode.c
@@ -391,12 +391,16 @@ static int parse_options(char *options, struct omfs_sb_info *sbi)
case Opt_uid:
if (match_int(&args[0], &option))
return 0;
- sbi->s_uid = option;
+ sbi->s_uid = make_kuid(current_user_ns(), option);
+ if (!uid_valid(sbi->s_uid))
+ return 0;
break;
case Opt_gid:
if (match_int(&args[0], &option))
return 0;
- sbi->s_gid = option;
+ sbi->s_gid = make_kgid(current_user_ns(), option);
+ if (!gid_valid(sbi->s_gid))
+ return 0;
break;
case Opt_umask:
if (match_octal(&args[0], &option))
diff --git a/fs/omfs/omfs.h b/fs/omfs/omfs.h
index 8941f12..f0f8bc7 100644
--- a/fs/omfs/omfs.h
+++ b/fs/omfs/omfs.h
@@ -19,8 +19,8 @@ struct omfs_sb_info {
unsigned long **s_imap;
int s_imap_size;
struct mutex s_bitmap_lock;
- int s_uid;
- int s_gid;
+ kuid_t s_uid;
+ kgid_t s_gid;
int s_dmask;
int s_fmask;
};
diff --git a/init/Kconfig b/init/Kconfig
index 0f65a02..390e629 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -950,7 +950,6 @@ config UIDGID_CONVERTED
depends on NFSD = n
depends on NFS_FS = n
depends on OCFS2_FS = n
- depends on OMFS_FS = n
depends on QNX4FS_FS = n
depends on QNX6FS_FS = n
depends on REISERFS_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 22/25] userns: Convert the qnx6 filesystem to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (16 preceding siblings ...)
2012-09-20 11:42 ` [PATCH 20/25] userns: Convert omfs " Eric W. Biederman
@ 2012-09-20 11:42 ` Eric W. Biederman
2012-09-20 11:42 ` [PATCH 23/25] userns: Convert the sysv " Eric W. Biederman
` (2 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:42 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kai Bankett
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Kai Bankett <chaosman-VMqxFixGRh2sTnJN9+BGXg@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/qnx6/inode.c | 4 ++--
init/Kconfig | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c
index 2049c81..f4eef0b 100644
--- a/fs/qnx6/inode.c
+++ b/fs/qnx6/inode.c
@@ -574,8 +574,8 @@ struct inode *qnx6_iget(struct super_block *sb, unsigned ino)
raw_inode = ((struct qnx6_inode_entry *)page_address(page)) + offs;
inode->i_mode = fs16_to_cpu(sbi, raw_inode->di_mode);
- inode->i_uid = (uid_t)fs32_to_cpu(sbi, raw_inode->di_uid);
- inode->i_gid = (gid_t)fs32_to_cpu(sbi, raw_inode->di_gid);
+ i_uid_write(inode, (uid_t)fs32_to_cpu(sbi, raw_inode->di_uid));
+ i_gid_write(inode, (gid_t)fs32_to_cpu(sbi, raw_inode->di_gid));
inode->i_size = fs64_to_cpu(sbi, raw_inode->di_size);
inode->i_mtime.tv_sec = fs32_to_cpu(sbi, raw_inode->di_mtime);
inode->i_mtime.tv_nsec = 0;
diff --git a/init/Kconfig b/init/Kconfig
index b9d6be5..1ff9f41 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -950,7 +950,6 @@ config UIDGID_CONVERTED
depends on NFSD = n
depends on NFS_FS = n
depends on OCFS2_FS = n
- depends on QNX6FS_FS = n
depends on REISERFS_FS = n
depends on SQUASHFS = n
depends on SYSV_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 23/25] userns: Convert the sysv filesystem to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (17 preceding siblings ...)
2012-09-20 11:42 ` [PATCH 22/25] userns: Convert the qnx6 filesystem to use kuid/kgid " Eric W. Biederman
@ 2012-09-20 11:42 ` Eric W. Biederman
2012-09-20 11:42 ` [PATCH 24/25] userns: Convert freevxfs " Eric W. Biederman
2012-09-20 11:42 ` [PATCH 25/25] userns: Convert ipathfs to use GLOBAL_ROOT_UID and GLOBAL_ROOT_GID Eric W. Biederman
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:42 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/sysv/inode.c | 8 ++++----
init/Kconfig | 1 -
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c
index 80e1e2b..b23ab73 100644
--- a/fs/sysv/inode.c
+++ b/fs/sysv/inode.c
@@ -202,8 +202,8 @@ struct inode *sysv_iget(struct super_block *sb, unsigned int ino)
}
/* SystemV FS: kludge permissions if ino==SYSV_ROOT_INO ?? */
inode->i_mode = fs16_to_cpu(sbi, raw_inode->i_mode);
- inode->i_uid = (uid_t)fs16_to_cpu(sbi, raw_inode->i_uid);
- inode->i_gid = (gid_t)fs16_to_cpu(sbi, raw_inode->i_gid);
+ i_uid_write(inode, (uid_t)fs16_to_cpu(sbi, raw_inode->i_uid));
+ i_gid_write(inode, (gid_t)fs16_to_cpu(sbi, raw_inode->i_gid));
set_nlink(inode, fs16_to_cpu(sbi, raw_inode->i_nlink));
inode->i_size = fs32_to_cpu(sbi, raw_inode->i_size);
inode->i_atime.tv_sec = fs32_to_cpu(sbi, raw_inode->i_atime);
@@ -256,8 +256,8 @@ static int __sysv_write_inode(struct inode *inode, int wait)
}
raw_inode->i_mode = cpu_to_fs16(sbi, inode->i_mode);
- raw_inode->i_uid = cpu_to_fs16(sbi, fs_high2lowuid(inode->i_uid));
- raw_inode->i_gid = cpu_to_fs16(sbi, fs_high2lowgid(inode->i_gid));
+ raw_inode->i_uid = cpu_to_fs16(sbi, fs_high2lowuid(i_uid_read(inode)));
+ raw_inode->i_gid = cpu_to_fs16(sbi, fs_high2lowgid(i_gid_read(inode)));
raw_inode->i_nlink = cpu_to_fs16(sbi, inode->i_nlink);
raw_inode->i_size = cpu_to_fs32(sbi, inode->i_size);
raw_inode->i_atime = cpu_to_fs32(sbi, inode->i_atime.tv_sec);
diff --git a/init/Kconfig b/init/Kconfig
index 1ff9f41..3427832 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -952,7 +952,6 @@ config UIDGID_CONVERTED
depends on OCFS2_FS = n
depends on REISERFS_FS = n
depends on SQUASHFS = n
- depends on SYSV_FS = n
depends on UBIFS_FS = n
depends on UDF_FS = n
depends on UFS_FS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 24/25] userns: Convert freevxfs to use kuid/kgid where appropriate
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (18 preceding siblings ...)
2012-09-20 11:42 ` [PATCH 23/25] userns: Convert the sysv " Eric W. Biederman
@ 2012-09-20 11:42 ` Eric W. Biederman
2012-09-20 11:42 ` [PATCH 25/25] userns: Convert ipathfs to use GLOBAL_ROOT_UID and GLOBAL_ROOT_GID Eric W. Biederman
20 siblings, 0 replies; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:42 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
fs/freevxfs/vxfs_inode.c | 4 ++--
init/Kconfig | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c
index ef67c95..f47df72 100644
--- a/fs/freevxfs/vxfs_inode.c
+++ b/fs/freevxfs/vxfs_inode.c
@@ -224,8 +224,8 @@ vxfs_iinit(struct inode *ip, struct vxfs_inode_info *vip)
{
ip->i_mode = vxfs_transmod(vip);
- ip->i_uid = (uid_t)vip->vii_uid;
- ip->i_gid = (gid_t)vip->vii_gid;
+ i_uid_write(ip, (uid_t)vip->vii_uid);
+ i_gid_write(ip, (gid_t)vip->vii_gid);
set_nlink(ip, vip->vii_nlink);
ip->i_size = vip->vii_size;
diff --git a/init/Kconfig b/init/Kconfig
index 3427832..355b1af 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -955,7 +955,6 @@ config UIDGID_CONVERTED
depends on UBIFS_FS = n
depends on UDF_FS = n
depends on UFS_FS = n
- depends on VXFS_FS = n
depends on XFS_FS = n
depends on !UML || HOSTFS = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 25/25] userns: Convert ipathfs to use GLOBAL_ROOT_UID and GLOBAL_ROOT_GID
[not found] ` <1348141326-23355-1-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
` (19 preceding siblings ...)
2012-09-20 11:42 ` [PATCH 24/25] userns: Convert freevxfs " Eric W. Biederman
@ 2012-09-20 11:42 ` Eric W. Biederman
[not found] ` <1348141326-23355-25-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
20 siblings, 1 reply; 41+ messages in thread
From: Eric W. Biederman @ 2012-09-20 11:42 UTC (permalink / raw)
To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA
Cc: Mike Marciniszyn, Linux Containers, Eric W. Biederman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Mike Marciniszyn <infinipath-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/qib/qib_fs.c | 4 ++--
init/Kconfig | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
index cff8a6c..65a2a23 100644
--- a/drivers/infiniband/hw/qib/qib_fs.c
+++ b/drivers/infiniband/hw/qib/qib_fs.c
@@ -61,8 +61,8 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
inode->i_ino = get_next_ino();
inode->i_mode = mode;
- inode->i_uid = 0;
- inode->i_gid = 0;
+ inode->i_uid = GLOBAL_ROOT_UID;
+ inode->i_gid = GLOBAL_ROOT_GID;
inode->i_blocks = 0;
inode->i_atime = CURRENT_TIME;
inode->i_mtime = inode->i_atime;
diff --git a/init/Kconfig b/init/Kconfig
index 355b1af..f0371a6 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -960,7 +960,6 @@ config UIDGID_CONVERTED
depends on !UML || HOSTFS = n
# The rare drivers that won't build
- depends on INFINIBAND_QIB = n
depends on BLK_DEV_LOOP = n
depends on ANDROID_BINDER_IPC = n
--
1.7.5.4
^ permalink raw reply related [flat|nested] 41+ messages in thread