aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/uid16.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-11-13 18:39:16 -0500
committerJames Morris <jmorris@namei.org>2008-11-13 18:39:16 -0500
commitb6dff3ec5e116e3af6f537d4caedcad6b9e5082a (patch)
tree9e76f972eb7ce9b84e0146c8e4126a3f86acb428 /kernel/uid16.c
parent15a2460ed0af7538ca8e6c610fe607a2cd9da142 (diff)
CRED: Separate task security context from task_struct
Separate the task security context from task_struct. At this point, the security data is temporarily embedded in the task_struct with two pointers pointing to it. Note that the Alpha arch is altered as it refers to (E)UID and (E)GID in entry.S via asm-offsets. With comment fixes Signed-off-by: Marc Dionne <marc.c.dionne@gmail.com> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: James Morris <jmorris@namei.org> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'kernel/uid16.c')
-rw-r--r--kernel/uid16.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/kernel/uid16.c b/kernel/uid16.c
index 3e41c1673e2f..71f07fc39fea 100644
--- a/kernel/uid16.c
+++ b/kernel/uid16.c
@@ -86,9 +86,9 @@ asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid,
86{ 86{
87 int retval; 87 int retval;
88 88
89 if (!(retval = put_user(high2lowuid(current->uid), ruid)) && 89 if (!(retval = put_user(high2lowuid(current->cred->uid), ruid)) &&
90 !(retval = put_user(high2lowuid(current->euid), euid))) 90 !(retval = put_user(high2lowuid(current->cred->euid), euid)))
91 retval = put_user(high2lowuid(current->suid), suid); 91 retval = put_user(high2lowuid(current->cred->suid), suid);
92 92
93 return retval; 93 return retval;
94} 94}
@@ -106,9 +106,9 @@ asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid,
106{ 106{
107 int retval; 107 int retval;
108 108
109 if (!(retval = put_user(high2lowgid(current->gid), rgid)) && 109 if (!(retval = put_user(high2lowgid(current->cred->gid), rgid)) &&
110 !(retval = put_user(high2lowgid(current->egid), egid))) 110 !(retval = put_user(high2lowgid(current->cred->egid), egid)))
111 retval = put_user(high2lowgid(current->sgid), sgid); 111 retval = put_user(high2lowgid(current->cred->sgid), sgid);
112 112
113 return retval; 113 return retval;
114} 114}
@@ -166,20 +166,20 @@ asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist)
166 if (gidsetsize < 0) 166 if (gidsetsize < 0)
167 return -EINVAL; 167 return -EINVAL;
168 168
169 get_group_info(current->group_info); 169 get_group_info(current->cred->group_info);
170 i = current->group_info->ngroups; 170 i = current->cred->group_info->ngroups;
171 if (gidsetsize) { 171 if (gidsetsize) {
172 if (i > gidsetsize) { 172 if (i > gidsetsize) {
173 i = -EINVAL; 173 i = -EINVAL;
174 goto out; 174 goto out;
175 } 175 }
176 if (groups16_to_user(grouplist, current->group_info)) { 176 if (groups16_to_user(grouplist, current->cred->group_info)) {
177 i = -EFAULT; 177 i = -EFAULT;
178 goto out; 178 goto out;
179 } 179 }
180 } 180 }
181out: 181out:
182 put_group_info(current->group_info); 182 put_group_info(current->cred->group_info);
183 return i; 183 return i;
184} 184}
185 185
@@ -210,20 +210,20 @@ asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist)
210 210
211asmlinkage long sys_getuid16(void) 211asmlinkage long sys_getuid16(void)
212{ 212{
213 return high2lowuid(current->uid); 213 return high2lowuid(current->cred->uid);
214} 214}
215 215
216asmlinkage long sys_geteuid16(void) 216asmlinkage long sys_geteuid16(void)
217{ 217{
218 return high2lowuid(current->euid); 218 return high2lowuid(current->cred->euid);
219} 219}
220 220
221asmlinkage long sys_getgid16(void) 221asmlinkage long sys_getgid16(void)
222{ 222{
223 return high2lowgid(current->gid); 223 return high2lowgid(current->cred->gid);
224} 224}
225 225
226asmlinkage long sys_getegid16(void) 226asmlinkage long sys_getegid16(void)
227{ 227{
228 return high2lowgid(current->egid); 228 return high2lowgid(current->cred->egid);
229} 229}