diff options
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index ebe65c2c9873..763c3c17ded3 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/task_io_accounting_ops.h> | 33 | #include <linux/task_io_accounting_ops.h> |
34 | #include <linux/seccomp.h> | 34 | #include <linux/seccomp.h> |
35 | #include <linux/cpu.h> | 35 | #include <linux/cpu.h> |
36 | #include <linux/ptrace.h> | ||
36 | 37 | ||
37 | #include <linux/compat.h> | 38 | #include <linux/compat.h> |
38 | #include <linux/syscalls.h> | 39 | #include <linux/syscalls.h> |
@@ -907,8 +908,8 @@ void do_sys_times(struct tms *tms) | |||
907 | struct task_cputime cputime; | 908 | struct task_cputime cputime; |
908 | cputime_t cutime, cstime; | 909 | cputime_t cutime, cstime; |
909 | 910 | ||
910 | spin_lock_irq(¤t->sighand->siglock); | ||
911 | thread_group_cputime(current, &cputime); | 911 | thread_group_cputime(current, &cputime); |
912 | spin_lock_irq(¤t->sighand->siglock); | ||
912 | cutime = current->signal->cutime; | 913 | cutime = current->signal->cutime; |
913 | cstime = current->signal->cstime; | 914 | cstime = current->signal->cstime; |
914 | spin_unlock_irq(¤t->sighand->siglock); | 915 | spin_unlock_irq(¤t->sighand->siglock); |
@@ -927,6 +928,7 @@ asmlinkage long sys_times(struct tms __user * tbuf) | |||
927 | if (copy_to_user(tbuf, &tmp, sizeof(struct tms))) | 928 | if (copy_to_user(tbuf, &tmp, sizeof(struct tms))) |
928 | return -EFAULT; | 929 | return -EFAULT; |
929 | } | 930 | } |
931 | force_successful_syscall_return(); | ||
930 | return (long) jiffies_64_to_clock_t(get_jiffies_64()); | 932 | return (long) jiffies_64_to_clock_t(get_jiffies_64()); |
931 | } | 933 | } |
932 | 934 | ||
@@ -1627,6 +1629,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r) | |||
1627 | utime = stime = cputime_zero; | 1629 | utime = stime = cputime_zero; |
1628 | 1630 | ||
1629 | if (who == RUSAGE_THREAD) { | 1631 | if (who == RUSAGE_THREAD) { |
1632 | utime = task_utime(current); | ||
1633 | stime = task_stime(current); | ||
1630 | accumulate_thread_rusage(p, r); | 1634 | accumulate_thread_rusage(p, r); |
1631 | goto out; | 1635 | goto out; |
1632 | } | 1636 | } |