git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netfilter: nf_conntrack: restrict runtime expect hashsize modifications
[safe/jmp/linux-2.6]
/
kernel
/
sys.c
diff --git
a/kernel/sys.c
b/kernel/sys.c
index
22ea955
..
585d6cd
100644
(file)
--- a/
kernel/sys.c
+++ b/
kernel/sys.c
@@
-911,16
+911,15
@@
change_okay:
void do_sys_times(struct tms *tms)
{
void do_sys_times(struct tms *tms)
{
- struct task_cputime cputime;
- cputime_t cutime, cstime;
+ cputime_t tgutime, tgstime, cutime, cstime;
- thread_group_cputime(current, &cputime);
spin_lock_irq(¤t->sighand->siglock);
spin_lock_irq(¤t->sighand->siglock);
+ thread_group_times(current, &tgutime, &tgstime);
cutime = current->signal->cutime;
cstime = current->signal->cstime;
spin_unlock_irq(¤t->sighand->siglock);
cutime = current->signal->cutime;
cstime = current->signal->cstime;
spin_unlock_irq(¤t->sighand->siglock);
- tms->tms_utime = cputime_to_clock_t(
cputime.
utime);
- tms->tms_stime = cputime_to_clock_t(
cputime.
stime);
+ tms->tms_utime = cputime_to_clock_t(
tg
utime);
+ tms->tms_stime = cputime_to_clock_t(
tg
stime);
tms->tms_cutime = cputime_to_clock_t(cutime);
tms->tms_cstime = cputime_to_clock_t(cstime);
}
tms->tms_cutime = cputime_to_clock_t(cutime);
tms->tms_cstime = cputime_to_clock_t(cstime);
}
@@
-1110,6
+1109,8
@@
SYSCALL_DEFINE0(setsid)
err = session;
out:
write_unlock_irq(&tasklist_lock);
err = session;
out:
write_unlock_irq(&tasklist_lock);
+ if (err > 0)
+ proc_sid_connector(group_leader);
return err;
}
return err;
}
@@
-1336,16
+1337,14
@@
static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
{
struct task_struct *t;
unsigned long flags;
{
struct task_struct *t;
unsigned long flags;
- cputime_t utime, stime;
- struct task_cputime cputime;
+ cputime_t tgutime, tgstime, utime, stime;
unsigned long maxrss = 0;
memset((char *) r, 0, sizeof *r);
utime = stime = cputime_zero;
if (who == RUSAGE_THREAD) {
unsigned long maxrss = 0;
memset((char *) r, 0, sizeof *r);
utime = stime = cputime_zero;
if (who == RUSAGE_THREAD) {
- utime = task_utime(current);
- stime = task_stime(current);
+ task_times(current, &utime, &stime);
accumulate_thread_rusage(p, r);
maxrss = p->signal->maxrss;
goto out;
accumulate_thread_rusage(p, r);
maxrss = p->signal->maxrss;
goto out;
@@
-1371,9
+1370,9
@@
static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
break;
case RUSAGE_SELF:
break;
case RUSAGE_SELF:
- thread_group_
cputime(p, &cpu
time);
- utime = cputime_add(utime,
cputime.
utime);
- stime = cputime_add(stime,
cputime.
stime);
+ thread_group_
times(p, &tgutime, &tgs
time);
+ utime = cputime_add(utime,
tg
utime);
+ stime = cputime_add(stime,
tg
stime);
r->ru_nvcsw += p->signal->nvcsw;
r->ru_nivcsw += p->signal->nivcsw;
r->ru_minflt += p->signal->min_flt;
r->ru_nvcsw += p->signal->nvcsw;
r->ru_nivcsw += p->signal->nivcsw;
r->ru_minflt += p->signal->min_flt;
@@
-1546,24
+1545,37
@@
SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
if (arg4 | arg5)
return -EINVAL;
switch (arg2) {
if (arg4 | arg5)
return -EINVAL;
switch (arg2) {
- case
0
:
+ case
PR_MCE_KILL_CLEAR
:
if (arg3 != 0)
return -EINVAL;
current->flags &= ~PF_MCE_PROCESS;
break;
if (arg3 != 0)
return -EINVAL;
current->flags &= ~PF_MCE_PROCESS;
break;
- case
1
:
+ case
PR_MCE_KILL_SET
:
current->flags |= PF_MCE_PROCESS;
current->flags |= PF_MCE_PROCESS;
- if (arg3
!= 0
)
+ if (arg3
== PR_MCE_KILL_EARLY
)
current->flags |= PF_MCE_EARLY;
current->flags |= PF_MCE_EARLY;
- else
+ else
if (arg3 == PR_MCE_KILL_LATE)
current->flags &= ~PF_MCE_EARLY;
current->flags &= ~PF_MCE_EARLY;
+ else if (arg3 == PR_MCE_KILL_DEFAULT)
+ current->flags &=
+ ~(PF_MCE_EARLY|PF_MCE_PROCESS);
+ else
+ return -EINVAL;
break;
default:
return -EINVAL;
}
error = 0;
break;
break;
default:
return -EINVAL;
}
error = 0;
break;
-
+ case PR_MCE_KILL_GET:
+ if (arg2 | arg3 | arg4 | arg5)
+ return -EINVAL;
+ if (current->flags & PF_MCE_PROCESS)
+ error = (current->flags & PF_MCE_EARLY) ?
+ PR_MCE_KILL_EARLY : PR_MCE_KILL_LATE;
+ else
+ error = PR_MCE_KILL_DEFAULT;
+ break;
default:
error = -EINVAL;
break;
default:
error = -EINVAL;
break;