git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
arch
/
mips
/
kernel
/
sysirix.c
diff --git
a/arch/mips/kernel/sysirix.c
b/arch/mips/kernel/sysirix.c
index
8aa6e23
..
e26ff1d
100644
(file)
--- a/
arch/mips/kernel/sysirix.c
+++ b/
arch/mips/kernel/sysirix.c
@@
-30,6
+30,7
@@
#include <linux/socket.h>
#include <linux/security.h>
#include <linux/syscalls.h>
#include <linux/socket.h>
#include <linux/security.h>
#include <linux/syscalls.h>
+#include <linux/vs_cvirt.h>
#include <asm/ptrace.h>
#include <asm/page.h>
#include <asm/ptrace.h>
#include <asm/page.h>
@@
-128,16
+129,21
@@
asmlinkage int irix_prctl(struct pt_regs *regs)
if (value > RLIM_INFINITY)
value = RLIM_INFINITY;
if (capable(CAP_SYS_ADMIN)) {
if (value > RLIM_INFINITY)
value = RLIM_INFINITY;
if (capable(CAP_SYS_ADMIN)) {
- current->rlim[RLIMIT_STACK].rlim_max =
- current->rlim[RLIMIT_STACK].rlim_cur = value;
+ task_lock(current->group_leader);
+ current->signal->rlim[RLIMIT_STACK].rlim_max =
+ current->signal->rlim[RLIMIT_STACK].rlim_cur = value;
+ task_unlock(current->group_leader);
error = value;
break;
}
error = value;
break;
}
- if (value > current->rlim[RLIMIT_STACK].rlim_max) {
+ task_lock(current->group_leader);
+ if (value > current->signal->rlim[RLIMIT_STACK].rlim_max) {
error = -EINVAL;
error = -EINVAL;
+ task_unlock(current->group_leader);
break;
}
break;
}
- current->rlim[RLIMIT_STACK].rlim_cur = value;
+ current->signal->rlim[RLIMIT_STACK].rlim_cur = value;
+ task_unlock(current->group_leader);
error = value;
break;
}
error = value;
break;
}
@@
-145,7
+151,7
@@
asmlinkage int irix_prctl(struct pt_regs *regs)
case PR_GETSTACKSIZE:
printk("irix_prctl[%s:%d]: Wants PR_GETSTACKSIZE\n",
current->comm, current->pid);
case PR_GETSTACKSIZE:
printk("irix_prctl[%s:%d]: Wants PR_GETSTACKSIZE\n",
current->comm, current->pid);
- error = current->rlim[RLIMIT_STACK].rlim_cur;
+ error = current->
signal->
rlim[RLIMIT_STACK].rlim_cur;
break;
case PR_MAXPPROCS:
break;
case PR_MAXPPROCS:
@@
-235,7
+241,7
@@
asmlinkage int irix_prctl(struct pt_regs *regs)
#undef DEBUG_PROCGRPS
extern unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt);
#undef DEBUG_PROCGRPS
extern unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt);
-extern int getrusage(struct task_struct *p, int who, struct rusage *ru);
+extern int getrusage(struct task_struct *p, int who, struct rusage
__user
*ru);
extern char *prom_getenv(char *name);
extern long prom_setenv(char *name, char *value);
extern char *prom_getenv(char *name);
extern long prom_setenv(char *name, char *value);
@@
-282,9
+288,9
@@
asmlinkage int irix_syssgi(struct pt_regs *regs)
int pid = (int) regs->regs[base + 5];
char *buf = (char *) regs->regs[base + 6];
struct task_struct *p;
int pid = (int) regs->regs[base + 5];
char *buf = (char *) regs->regs[base + 6];
struct task_struct *p;
- char
comm[16
];
+ char
tcomm[sizeof(current->comm)
];
- retval = verify_area(VERIFY_WRITE, buf,
16
);
+ retval = verify_area(VERIFY_WRITE, buf,
sizeof(tcomm)
);
if (retval)
break;
read_lock(&tasklist_lock);
if (retval)
break;
read_lock(&tasklist_lock);
@@
-294,11
+300,11
@@
asmlinkage int irix_syssgi(struct pt_regs *regs)
retval = -ESRCH;
break;
}
retval = -ESRCH;
break;
}
-
memcpy(comm, p->comm, 16
);
+
get_task_comm(tcomm, p
);
read_unlock(&tasklist_lock);
/* XXX Need to check sizes. */
read_unlock(&tasklist_lock);
/* XXX Need to check sizes. */
- copy_to_user(buf,
p->comm, 16
);
+ copy_to_user(buf,
tcomm, sizeof(tcomm)
);
retval = 0;
break;
}
retval = 0;
break;
}
@@
-558,7
+564,7
@@
asmlinkage int irix_brk(unsigned long brk)
/*
* Check against rlimit and stack..
*/
/*
* Check against rlimit and stack..
*/
- rlim = current->rlim[RLIMIT_DATA].rlim_cur;
+ rlim = current->
signal->
rlim[RLIMIT_DATA].rlim_cur;
if (rlim >= RLIM_INFINITY)
rlim = ~0;
if (brk - mm->end_code > rlim) {
if (rlim >= RLIM_INFINITY)
rlim = ~0;
if (brk - mm->end_code > rlim) {
@@
-615,8
+621,14
@@
asmlinkage int irix_getgid(struct pt_regs *regs)
asmlinkage int irix_stime(int value)
{
asmlinkage int irix_stime(int value)
{
- if (!capable(CAP_SYS_TIME))
- return -EPERM;
+ int err;
+ struct timespec tv;
+
+ tv.tv_sec = value;
+ tv.tv_nsec = 0;
+ err = security_settime(&tv, NULL);
+ if (err)
+ return err;
write_seqlock_irq(&xtime_lock);
xtime.tv_sec = value;
write_seqlock_irq(&xtime_lock);
xtime.tv_sec = value;
@@
-811,8
+823,8
@@
asmlinkage int irix_times(struct tms * tbuf)
return err;
err |= __put_user(current->utime, &tbuf->tms_utime);
err |= __put_user(current->stime, &tbuf->tms_stime);
return err;
err |= __put_user(current->utime, &tbuf->tms_utime);
err |= __put_user(current->stime, &tbuf->tms_stime);
- err |= __put_user(current->cutime, &tbuf->tms_cutime);
- err |= __put_user(current->cstime, &tbuf->tms_cstime);
+ err |= __put_user(current->
signal->
cutime, &tbuf->tms_cutime);
+ err |= __put_user(current->
signal->
cstime, &tbuf->tms_cstime);
}
return err;
}
return err;
@@
-914,8
+926,8
@@
asmlinkage int irix_getdomainname(char *name, int len)
return error;
down_read(&uts_sem);
return error;
down_read(&uts_sem);
- if
(len > (__NEW_UTS_LEN - 1)
)
- len = __NEW_UTS_LEN
- 1
;
+ if
(len > __NEW_UTS_LEN
)
+ len = __NEW_UTS_LEN;
error = 0;
if (copy_to_user(name, system_utsname.domainname, len))
error = -EFAULT;
error = 0;
if (copy_to_user(name, system_utsname.domainname, len))
error = -EFAULT;
@@
-1638,9
+1650,9
@@
asmlinkage int irix_statvfs64(char *fname, struct irix_statvfs64 *buf)
struct kstatfs kbuf;
int error, i;
struct kstatfs kbuf;
int error, i;
- printk("[%s:%d] Wheee.. irix_statvfs(%s,%p)\n",
+ printk("[%s:%d] Wheee.. irix_statvfs
64
(%s,%p)\n",
current->comm, current->pid, fname, buf);
current->comm, current->pid, fname, buf);
- error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs));
+ error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs
64
));
if(error)
goto out;
error = user_path_walk(fname, &nd);
if(error)
goto out;
error = user_path_walk(fname, &nd);
@@
-1684,7
+1696,7
@@
asmlinkage int irix_fstatvfs64(int fd, struct irix_statvfs *buf)
struct file *file;
int error, i;
struct file *file;
int error, i;
- printk("[%s:%d] Wheee.. irix_fstatvfs(%d,%p)\n",
+ printk("[%s:%d] Wheee.. irix_fstatvfs
64
(%d,%p)\n",
current->comm, current->pid, fd, buf);
error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs));
current->comm, current->pid, fd, buf);
error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs));
@@
-2133,7
+2145,7
@@
asmlinkage int irix_ulimit(int cmd, int arg)
retval = -EINVAL;
goto out;
#endif
retval = -EINVAL;
goto out;
#endif
- retval = current->rlim[RLIMIT_NOFILE].rlim_cur;
+ retval = current->
signal->
rlim[RLIMIT_NOFILE].rlim_cur;
goto out;
case 5:
goto out;
case 5: