aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2008-12-31 13:56:05 -0500
committerPierre Ossman <drzeus@drzeus.cx>2008-12-31 13:56:05 -0500
commit418f19ea17a99421b22a64e101e14b6a16bed66d (patch)
tree7c21fcc368c63f1f9907deac6d16b30bd371792d /arch/mips/kernel
parent98444d3dd975653a4a970ecc0dfc30918da92f60 (diff)
parentf6e10b865c3ea56bdaa8c6ecfee313b997900dbb (diff)
Merge branch 'master' of ../mmc
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/kspd.c4
-rw-r--r--arch/mips/kernel/mips-mt-fpaff.c5
-rw-r--r--arch/mips/kernel/scall32-o32.S7
-rw-r--r--arch/mips/kernel/scall64-n32.S2
-rw-r--r--arch/mips/kernel/scall64-o32.S16
-rw-r--r--arch/mips/kernel/vpe.c6
6 files changed, 18 insertions, 22 deletions
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
index b0591ae0ce56..fd6e51224034 100644
--- a/arch/mips/kernel/kspd.c
+++ b/arch/mips/kernel/kspd.c
@@ -174,8 +174,8 @@ static unsigned int translate_open_flags(int flags)
174 174
175static void sp_setfsuidgid( uid_t uid, gid_t gid) 175static void sp_setfsuidgid( uid_t uid, gid_t gid)
176{ 176{
177 current->fsuid = uid; 177 current->cred->fsuid = uid;
178 current->fsgid = gid; 178 current->cred->fsgid = gid;
179 179
180 key_fsuid_changed(current); 180 key_fsuid_changed(current);
181 key_fsgid_changed(current); 181 key_fsgid_changed(current);
diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c
index dc9eb72ed9de..5e77a3a21f98 100644
--- a/arch/mips/kernel/mips-mt-fpaff.c
+++ b/arch/mips/kernel/mips-mt-fpaff.c
@@ -51,6 +51,7 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
51 int retval; 51 int retval;
52 struct task_struct *p; 52 struct task_struct *p;
53 struct thread_info *ti; 53 struct thread_info *ti;
54 uid_t euid;
54 55
55 if (len < sizeof(new_mask)) 56 if (len < sizeof(new_mask))
56 return -EINVAL; 57 return -EINVAL;
@@ -76,9 +77,9 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
76 */ 77 */
77 get_task_struct(p); 78 get_task_struct(p);
78 79
80 euid = current_euid();
79 retval = -EPERM; 81 retval = -EPERM;
80 if ((current->euid != p->euid) && (current->euid != p->uid) && 82 if (euid != p->euid && euid != p->uid && !capable(CAP_SYS_NICE)) {
81 !capable(CAP_SYS_NICE)) {
82 read_unlock(&tasklist_lock); 83 read_unlock(&tasklist_lock);
83 goto out_unlock; 84 goto out_unlock;
84 } 85 }
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 759f68066b5d..d0916a55cd77 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -262,14 +262,11 @@ bad_alignment:
262 LEAF(sys_syscall) 262 LEAF(sys_syscall)
263 subu t0, a0, __NR_O32_Linux # check syscall number 263 subu t0, a0, __NR_O32_Linux # check syscall number
264 sltiu v0, t0, __NR_O32_Linux_syscalls + 1 264 sltiu v0, t0, __NR_O32_Linux_syscalls + 1
265 beqz t0, einval # do not recurse
265 sll t1, t0, 3 266 sll t1, t0, 3
266 beqz v0, einval 267 beqz v0, einval
267
268 lw t2, sys_call_table(t1) # syscall routine 268 lw t2, sys_call_table(t1) # syscall routine
269 269
270 li v1, 4000 - __NR_O32_Linux # index of sys_syscall
271 beq t0, v1, einval # do not recurse
272
273 /* Some syscalls like execve get their arguments from struct pt_regs 270 /* Some syscalls like execve get their arguments from struct pt_regs
274 and claim zero arguments in the syscall table. Thus we have to 271 and claim zero arguments in the syscall table. Thus we have to
275 assume the worst case and shuffle around all potential arguments. 272 assume the worst case and shuffle around all potential arguments.
@@ -627,7 +624,7 @@ einval: li v0, -ENOSYS
627 sys sys_pselect6 6 624 sys sys_pselect6 6
628 sys sys_ppoll 5 625 sys sys_ppoll 5
629 sys sys_unshare 1 626 sys sys_unshare 1
630 sys sys_splice 4 627 sys sys_splice 6
631 sys sys_sync_file_range 7 /* 4305 */ 628 sys sys_sync_file_range 7 /* 4305 */
632 sys sys_tee 4 629 sys sys_tee 4
633 sys sys_vmsplice 4 630 sys sys_vmsplice 4
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index e266b3aa6560..30f3b6317a83 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -390,7 +390,7 @@ EXPORT(sysn32_call_table)
390 PTR sys_splice 390 PTR sys_splice
391 PTR sys_sync_file_range 391 PTR sys_sync_file_range
392 PTR sys_tee 392 PTR sys_tee
393 PTR sys_vmsplice /* 6270 */ 393 PTR compat_sys_vmsplice /* 6270 */
394 PTR sys_move_pages 394 PTR sys_move_pages
395 PTR compat_sys_set_robust_list 395 PTR compat_sys_set_robust_list
396 PTR compat_sys_get_robust_list 396 PTR compat_sys_get_robust_list
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 6c7ef8313ebd..fefef4af8595 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -174,14 +174,12 @@ not_o32_scall:
174 END(handle_sys) 174 END(handle_sys)
175 175
176LEAF(sys32_syscall) 176LEAF(sys32_syscall)
177 sltu v0, a0, __NR_O32_Linux + __NR_O32_Linux_syscalls + 1 177 subu t0, a0, __NR_O32_Linux # check syscall number
178 sltiu v0, t0, __NR_O32_Linux_syscalls + 1
179 beqz t0, einval # do not recurse
180 dsll t1, t0, 3
178 beqz v0, einval 181 beqz v0, einval
179 182 ld t2, sys_call_table(t1) # syscall routine
180 dsll v0, a0, 3
181 ld t2, (sys_call_table - (__NR_O32_Linux * 8))(v0)
182
183 li v1, 4000 # indirect syscall number
184 beq a0, v1, einval # do not recurse
185 183
186 move a0, a1 # shift argument registers 184 move a0, a1 # shift argument registers
187 move a1, a2 185 move a1, a2
@@ -198,7 +196,7 @@ LEAF(sys32_syscall)
198 jr t2 196 jr t2
199 /* Unreached */ 197 /* Unreached */
200 198
201einval: li v0, -EINVAL 199einval: li v0, -ENOSYS
202 jr ra 200 jr ra
203 END(sys32_syscall) 201 END(sys32_syscall)
204 202
@@ -512,7 +510,7 @@ sys_call_table:
512 PTR sys_splice 510 PTR sys_splice
513 PTR sys32_sync_file_range /* 4305 */ 511 PTR sys32_sync_file_range /* 4305 */
514 PTR sys_tee 512 PTR sys_tee
515 PTR sys_vmsplice 513 PTR compat_sys_vmsplice
516 PTR compat_sys_move_pages 514 PTR compat_sys_move_pages
517 PTR compat_sys_set_robust_list 515 PTR compat_sys_set_robust_list
518 PTR compat_sys_get_robust_list /* 4310 */ 516 PTR compat_sys_get_robust_list /* 4310 */
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 972b2d2b8401..010b27e01f7b 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -1085,8 +1085,8 @@ static int vpe_open(struct inode *inode, struct file *filp)
1085 v->load_addr = NULL; 1085 v->load_addr = NULL;
1086 v->len = 0; 1086 v->len = 0;
1087 1087
1088 v->uid = filp->f_uid; 1088 v->uid = filp->f_cred->fsuid;
1089 v->gid = filp->f_gid; 1089 v->gid = filp->f_cred->fsgid;
1090 1090
1091#ifdef CONFIG_MIPS_APSP_KSPD 1091#ifdef CONFIG_MIPS_APSP_KSPD
1092 /* get kspd to tell us when a syscall_exit happens */ 1092 /* get kspd to tell us when a syscall_exit happens */
@@ -1134,7 +1134,7 @@ static int vpe_release(struct inode *inode, struct file *filp)
1134 1134
1135 /* It's good to be able to run the SP and if it chokes have a look at 1135 /* It's good to be able to run the SP and if it chokes have a look at
1136 the /dev/rt?. But if we reset the pointer to the shared struct we 1136 the /dev/rt?. But if we reset the pointer to the shared struct we
1137 loose what has happened. So perhaps if garbage is sent to the vpe 1137 lose what has happened. So perhaps if garbage is sent to the vpe
1138 device, use it as a trigger for the reset. Hopefully a nice 1138 device, use it as a trigger for the reset. Hopefully a nice
1139 executable will be along shortly. */ 1139 executable will be along shortly. */
1140 if (ret < 0) 1140 if (ret < 0)