diff options
-rw-r--r-- | fs/coda/coda_linux.c | 8 | ||||
-rw-r--r-- | fs/coda/psdev.c | 3 | ||||
-rw-r--r-- | fs/coda/upcall.c | 6 | ||||
-rw-r--r-- | include/linux/coda_psdev.h | 2 |
4 files changed, 11 insertions, 8 deletions
diff --git a/fs/coda/coda_linux.c b/fs/coda/coda_linux.c index 854ace712685..2849f41e72a2 100644 --- a/fs/coda/coda_linux.c +++ b/fs/coda/coda_linux.c | |||
@@ -100,9 +100,9 @@ void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr) | |||
100 | if (attr->va_mode != (u_short) -1) | 100 | if (attr->va_mode != (u_short) -1) |
101 | inode->i_mode = attr->va_mode | inode_type; | 101 | inode->i_mode = attr->va_mode | inode_type; |
102 | if (attr->va_uid != -1) | 102 | if (attr->va_uid != -1) |
103 | inode->i_uid = (uid_t) attr->va_uid; | 103 | inode->i_uid = make_kuid(&init_user_ns, (uid_t) attr->va_uid); |
104 | if (attr->va_gid != -1) | 104 | if (attr->va_gid != -1) |
105 | inode->i_gid = (gid_t) attr->va_gid; | 105 | inode->i_gid = make_kgid(&init_user_ns, (gid_t) attr->va_gid); |
106 | if (attr->va_nlink != -1) | 106 | if (attr->va_nlink != -1) |
107 | set_nlink(inode, attr->va_nlink); | 107 | set_nlink(inode, attr->va_nlink); |
108 | if (attr->va_size != -1) | 108 | if (attr->va_size != -1) |
@@ -171,10 +171,10 @@ void coda_iattr_to_vattr(struct iattr *iattr, struct coda_vattr *vattr) | |||
171 | vattr->va_mode = iattr->ia_mode; | 171 | vattr->va_mode = iattr->ia_mode; |
172 | } | 172 | } |
173 | if ( valid & ATTR_UID ) { | 173 | if ( valid & ATTR_UID ) { |
174 | vattr->va_uid = (vuid_t) iattr->ia_uid; | 174 | vattr->va_uid = (vuid_t) from_kuid(&init_user_ns, iattr->ia_uid); |
175 | } | 175 | } |
176 | if ( valid & ATTR_GID ) { | 176 | if ( valid & ATTR_GID ) { |
177 | vattr->va_gid = (vgid_t) iattr->ia_gid; | 177 | vattr->va_gid = (vgid_t) from_kgid(&init_user_ns, iattr->ia_gid); |
178 | } | 178 | } |
179 | if ( valid & ATTR_SIZE ) { | 179 | if ( valid & ATTR_SIZE ) { |
180 | vattr->va_size = iattr->ia_size; | 180 | vattr->va_size = iattr->ia_size; |
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index dd60f905d4fe..ebc2bae6c289 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
@@ -270,6 +270,9 @@ static int coda_psdev_open(struct inode * inode, struct file * file) | |||
270 | if (task_active_pid_ns(current) != &init_pid_ns) | 270 | if (task_active_pid_ns(current) != &init_pid_ns) |
271 | return -EINVAL; | 271 | return -EINVAL; |
272 | 272 | ||
273 | if (current_user_ns() != &init_user_ns) | ||
274 | return -EINVAL; | ||
275 | |||
273 | idx = iminor(inode); | 276 | idx = iminor(inode); |
274 | if (idx < 0 || idx >= MAX_CODADEVS) | 277 | if (idx < 0 || idx >= MAX_CODADEVS) |
275 | return -ENODEV; | 278 | return -ENODEV; |
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c index 5c6d2cd6ee86..3a731976dc5e 100644 --- a/fs/coda/upcall.c +++ b/fs/coda/upcall.c | |||
@@ -52,7 +52,7 @@ static void *alloc_upcall(int opcode, int size) | |||
52 | inp->ih.opcode = opcode; | 52 | inp->ih.opcode = opcode; |
53 | inp->ih.pid = task_pid_nr_ns(current, &init_pid_ns); | 53 | inp->ih.pid = task_pid_nr_ns(current, &init_pid_ns); |
54 | inp->ih.pgid = task_pgrp_nr_ns(current, &init_pid_ns); | 54 | inp->ih.pgid = task_pgrp_nr_ns(current, &init_pid_ns); |
55 | inp->ih.uid = current_fsuid(); | 55 | inp->ih.uid = from_kuid(&init_user_ns, current_fsuid()); |
56 | 56 | ||
57 | return (void*)inp; | 57 | return (void*)inp; |
58 | } | 58 | } |
@@ -157,7 +157,7 @@ int venus_lookup(struct super_block *sb, struct CodaFid *fid, | |||
157 | } | 157 | } |
158 | 158 | ||
159 | int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, | 159 | int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, |
160 | vuid_t uid) | 160 | kuid_t uid) |
161 | { | 161 | { |
162 | union inputArgs *inp; | 162 | union inputArgs *inp; |
163 | union outputArgs *outp; | 163 | union outputArgs *outp; |
@@ -166,7 +166,7 @@ int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, | |||
166 | insize = SIZE(release); | 166 | insize = SIZE(release); |
167 | UPARG(CODA_CLOSE); | 167 | UPARG(CODA_CLOSE); |
168 | 168 | ||
169 | inp->ih.uid = uid; | 169 | inp->ih.uid = from_kuid(&init_user_ns, uid); |
170 | inp->coda_close.VFid = *fid; | 170 | inp->coda_close.VFid = *fid; |
171 | inp->coda_close.flags = flags; | 171 | inp->coda_close.flags = flags; |
172 | 172 | ||
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 8031d6eef102..5b8721efa948 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h | |||
@@ -34,7 +34,7 @@ int venus_lookup(struct super_block *sb, struct CodaFid *fid, | |||
34 | const char *name, int length, int *type, | 34 | const char *name, int length, int *type, |
35 | struct CodaFid *resfid); | 35 | struct CodaFid *resfid); |
36 | int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, | 36 | int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, |
37 | vuid_t uid); | 37 | kuid_t uid); |
38 | int venus_open(struct super_block *sb, struct CodaFid *fid, int flags, | 38 | int venus_open(struct super_block *sb, struct CodaFid *fid, int flags, |
39 | struct file **f); | 39 | struct file **f); |
40 | int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid, | 40 | int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid, |