diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2014-01-21 13:28:15 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2014-01-22 18:20:46 -0500 |
commit | f58437f1f9161847c636e4fed5569ed5b908af36 (patch) | |
tree | 2bdfb9892f961534dd52b1ecf88632166d321290 /arch/mips | |
parent | 261000a56b6382f597bcb12000f55c9ff26a1efb (diff) |
MIPS: VPE: Remove vpe_getuid and vpe_getgid
The linux build-bot recently reported a build error in arch/mips/kernel/vpe.c
tree: git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git for-linus
head: 261000a56b6382f597bcb12000f55c9ff26a1efb
commit: 261000a56b6382f597bcb12000f55c9ff26a1efb [4/4] userns: userns: Remove UIDGID_STRICT_TYPE_CHECKS
config: make ARCH=mips maltaaprp_defconfig
All error/warnings:
arch/mips/kernel/vpe.c: In function 'vpe_open':
>> arch/mips/kernel/vpe.c:1086:9: error: incompatible types when assigning to type 'unsigned int' from type 'kuid_t'
>> arch/mips/kernel/vpe.c:1087:9: error: incompatible types when assigning to type 'unsigned int' from type 'kgid_t'
vim +1086 arch/mips/kernel/vpe.c
863abad4 Jesper Juhl 2010-10-30 1080 return -ENOMEM;
863abad4 Jesper Juhl 2010-10-30 1081 }
e01402b1 Ralf Baechle 2005-07-14 1082 v->plen = P_SIZE;
e01402b1 Ralf Baechle 2005-07-14 1083 v->load_addr = NULL;
e01402b1 Ralf Baechle 2005-07-14 1084 v->len = 0;
e01402b1 Ralf Baechle 2005-07-14 1085
d76b0d9b David Howells 2008-11-14 @1086 v->uid = filp->f_cred->fsuid;
d76b0d9b David Howells 2008-11-14 @1087 v->gid = filp->f_cred->fsgid;
2600990e Ralf Baechle 2006-04-05 1088
2600990e Ralf Baechle 2006-04-05 1089 v->cwd[0] = 0;
2600990e Ralf Baechle 2006-04-05 1090 ret = getcwd(v->cwd, VPE_PATH_MAX);
When examining the code to see what v->uid and v->gid were used for I
discovered that the only users in the kernel are vpe_getuid and
vpe_getgid, and that vpe_getuid and vpe_getgid are never called.
So instead of proposing a conversion to use kuid_t and kgid_t instead
of unsigned int/int as I normally would let's just kill this dead code
so no one has to worry about it further.
Deng-Cheng Zhu said:
This is a good catch. vpe_get[u|g]id was originally used by KSPD which
has been removed.
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Reviewed-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/include/asm/vpe.h | 2 | ||||
-rw-r--r-- | arch/mips/kernel/vpe.c | 28 |
2 files changed, 0 insertions, 30 deletions
diff --git a/arch/mips/include/asm/vpe.h b/arch/mips/include/asm/vpe.h index c6e1b961537d..0880fe8809b1 100644 --- a/arch/mips/include/asm/vpe.h +++ b/arch/mips/include/asm/vpe.h | |||
@@ -30,8 +30,6 @@ struct vpe_notifications { | |||
30 | extern int vpe_notify(int index, struct vpe_notifications *notify); | 30 | extern int vpe_notify(int index, struct vpe_notifications *notify); |
31 | 31 | ||
32 | extern void *vpe_get_shared(int index); | 32 | extern void *vpe_get_shared(int index); |
33 | extern int vpe_getuid(int index); | ||
34 | extern int vpe_getgid(int index); | ||
35 | extern char *vpe_getcwd(int index); | 33 | extern char *vpe_getcwd(int index); |
36 | 34 | ||
37 | #endif /* _ASM_VPE_H */ | 35 | #endif /* _ASM_VPE_H */ |
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 59b2b3cd7885..2d5c142bad67 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -105,7 +105,6 @@ struct vpe { | |||
105 | unsigned long len; | 105 | unsigned long len; |
106 | char *pbuffer; | 106 | char *pbuffer; |
107 | unsigned long plen; | 107 | unsigned long plen; |
108 | unsigned int uid, gid; | ||
109 | char cwd[VPE_PATH_MAX]; | 108 | char cwd[VPE_PATH_MAX]; |
110 | 109 | ||
111 | unsigned long __start; | 110 | unsigned long __start; |
@@ -1083,9 +1082,6 @@ static int vpe_open(struct inode *inode, struct file *filp) | |||
1083 | v->load_addr = NULL; | 1082 | v->load_addr = NULL; |
1084 | v->len = 0; | 1083 | v->len = 0; |
1085 | 1084 | ||
1086 | v->uid = filp->f_cred->fsuid; | ||
1087 | v->gid = filp->f_cred->fsgid; | ||
1088 | |||
1089 | v->cwd[0] = 0; | 1085 | v->cwd[0] = 0; |
1090 | ret = getcwd(v->cwd, VPE_PATH_MAX); | 1086 | ret = getcwd(v->cwd, VPE_PATH_MAX); |
1091 | if (ret < 0) | 1087 | if (ret < 0) |
@@ -1269,30 +1265,6 @@ void *vpe_get_shared(int index) | |||
1269 | 1265 | ||
1270 | EXPORT_SYMBOL(vpe_get_shared); | 1266 | EXPORT_SYMBOL(vpe_get_shared); |
1271 | 1267 | ||
1272 | int vpe_getuid(int index) | ||
1273 | { | ||
1274 | struct vpe *v; | ||
1275 | |||
1276 | if ((v = get_vpe(index)) == NULL) | ||
1277 | return -1; | ||
1278 | |||
1279 | return v->uid; | ||
1280 | } | ||
1281 | |||
1282 | EXPORT_SYMBOL(vpe_getuid); | ||
1283 | |||
1284 | int vpe_getgid(int index) | ||
1285 | { | ||
1286 | struct vpe *v; | ||
1287 | |||
1288 | if ((v = get_vpe(index)) == NULL) | ||
1289 | return -1; | ||
1290 | |||
1291 | return v->gid; | ||
1292 | } | ||
1293 | |||
1294 | EXPORT_SYMBOL(vpe_getgid); | ||
1295 | |||
1296 | int vpe_notify(int index, struct vpe_notifications *notify) | 1268 | int vpe_notify(int index, struct vpe_notifications *notify) |
1297 | { | 1269 | { |
1298 | struct vpe *v; | 1270 | struct vpe *v; |