aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/compat.c8
-rw-r--r--kernel/exit.c22
-rw-r--r--kernel/fork.c24
-rw-r--r--kernel/pid.c11
-rw-r--r--kernel/signal.c22
-rw-r--r--kernel/stop_machine.c4
-rw-r--r--kernel/sys.c14
-rw-r--r--kernel/sys_ni.c5
8 files changed, 86 insertions, 24 deletions
diff --git a/kernel/compat.c b/kernel/compat.c
index cebb4c28c039..3bae3742c2aa 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -475,8 +475,8 @@ asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
475 return min_length; 475 return min_length;
476} 476}
477 477
478static int get_compat_itimerspec(struct itimerspec *dst, 478int get_compat_itimerspec(struct itimerspec *dst,
479 struct compat_itimerspec __user *src) 479 const struct compat_itimerspec __user *src)
480{ 480{
481 if (get_compat_timespec(&dst->it_interval, &src->it_interval) || 481 if (get_compat_timespec(&dst->it_interval, &src->it_interval) ||
482 get_compat_timespec(&dst->it_value, &src->it_value)) 482 get_compat_timespec(&dst->it_value, &src->it_value))
@@ -484,8 +484,8 @@ static int get_compat_itimerspec(struct itimerspec *dst,
484 return 0; 484 return 0;
485} 485}
486 486
487static int put_compat_itimerspec(struct compat_itimerspec __user *dst, 487int put_compat_itimerspec(struct compat_itimerspec __user *dst,
488 struct itimerspec *src) 488 const struct itimerspec *src)
489{ 489{
490 if (put_compat_timespec(&src->it_interval, &dst->it_interval) || 490 if (put_compat_timespec(&src->it_interval, &dst->it_interval) ||
491 put_compat_timespec(&src->it_value, &dst->it_value)) 491 put_compat_timespec(&src->it_value, &dst->it_value))
diff --git a/kernel/exit.c b/kernel/exit.c
index b0c6f0c3a2df..c6d14b8008dd 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -24,6 +24,7 @@
24#include <linux/pid_namespace.h> 24#include <linux/pid_namespace.h>
25#include <linux/ptrace.h> 25#include <linux/ptrace.h>
26#include <linux/profile.h> 26#include <linux/profile.h>
27#include <linux/signalfd.h>
27#include <linux/mount.h> 28#include <linux/mount.h>
28#include <linux/proc_fs.h> 29#include <linux/proc_fs.h>
29#include <linux/kthread.h> 30#include <linux/kthread.h>
@@ -42,6 +43,7 @@
42#include <linux/audit.h> /* for audit_free() */ 43#include <linux/audit.h> /* for audit_free() */
43#include <linux/resource.h> 44#include <linux/resource.h>
44#include <linux/blkdev.h> 45#include <linux/blkdev.h>
46#include <linux/task_io_accounting_ops.h>
45 47
46#include <asm/uaccess.h> 48#include <asm/uaccess.h>
47#include <asm/unistd.h> 49#include <asm/unistd.h>
@@ -82,6 +84,14 @@ static void __exit_signal(struct task_struct *tsk)
82 sighand = rcu_dereference(tsk->sighand); 84 sighand = rcu_dereference(tsk->sighand);
83 spin_lock(&sighand->siglock); 85 spin_lock(&sighand->siglock);
84 86
87 /*
88 * Notify that this sighand has been detached. This must
89 * be called with the tsk->sighand lock held. Also, this
90 * access tsk->sighand internally, so it must be called
91 * before tsk->sighand is reset.
92 */
93 signalfd_detach_locked(tsk);
94
85 posix_cpu_timers_exit(tsk); 95 posix_cpu_timers_exit(tsk);
86 if (atomic_dec_and_test(&sig->count)) 96 if (atomic_dec_and_test(&sig->count))
87 posix_cpu_timers_exit_group(tsk); 97 posix_cpu_timers_exit_group(tsk);
@@ -113,6 +123,8 @@ static void __exit_signal(struct task_struct *tsk)
113 sig->nvcsw += tsk->nvcsw; 123 sig->nvcsw += tsk->nvcsw;
114 sig->nivcsw += tsk->nivcsw; 124 sig->nivcsw += tsk->nivcsw;
115 sig->sched_time += tsk->sched_time; 125 sig->sched_time += tsk->sched_time;
126 sig->inblock += task_io_get_inblock(tsk);
127 sig->oublock += task_io_get_oublock(tsk);
116 sig = NULL; /* Marker for below. */ 128 sig = NULL; /* Marker for below. */
117 } 129 }
118 130
@@ -299,12 +311,12 @@ void __set_special_pids(pid_t session, pid_t pgrp)
299 if (process_session(curr) != session) { 311 if (process_session(curr) != session) {
300 detach_pid(curr, PIDTYPE_SID); 312 detach_pid(curr, PIDTYPE_SID);
301 set_signal_session(curr->signal, session); 313 set_signal_session(curr->signal, session);
302 attach_pid(curr, PIDTYPE_SID, session); 314 attach_pid(curr, PIDTYPE_SID, find_pid(session));
303 } 315 }
304 if (process_group(curr) != pgrp) { 316 if (process_group(curr) != pgrp) {
305 detach_pid(curr, PIDTYPE_PGID); 317 detach_pid(curr, PIDTYPE_PGID);
306 curr->signal->pgrp = pgrp; 318 curr->signal->pgrp = pgrp;
307 attach_pid(curr, PIDTYPE_PGID, pgrp); 319 attach_pid(curr, PIDTYPE_PGID, find_pid(pgrp));
308 } 320 }
309} 321}
310 322
@@ -1193,6 +1205,12 @@ static int wait_task_zombie(struct task_struct *p, int noreap,
1193 p->nvcsw + sig->nvcsw + sig->cnvcsw; 1205 p->nvcsw + sig->nvcsw + sig->cnvcsw;
1194 psig->cnivcsw += 1206 psig->cnivcsw +=
1195 p->nivcsw + sig->nivcsw + sig->cnivcsw; 1207 p->nivcsw + sig->nivcsw + sig->cnivcsw;
1208 psig->cinblock +=
1209 task_io_get_inblock(p) +
1210 sig->inblock + sig->cinblock;
1211 psig->coublock +=
1212 task_io_get_oublock(p) +
1213 sig->oublock + sig->coublock;
1196 spin_unlock_irq(&p->parent->sighand->siglock); 1214 spin_unlock_irq(&p->parent->sighand->siglock);
1197 } 1215 }
1198 1216
diff --git a/kernel/fork.c b/kernel/fork.c
index 5dd3979747f5..49530e40ea8b 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -875,6 +875,7 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts
875 sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero; 875 sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero;
876 sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0; 876 sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0;
877 sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0; 877 sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0;
878 sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0;
878 sig->sched_time = 0; 879 sig->sched_time = 0;
879 INIT_LIST_HEAD(&sig->cpu_timers[0]); 880 INIT_LIST_HEAD(&sig->cpu_timers[0]);
880 INIT_LIST_HEAD(&sig->cpu_timers[1]); 881 INIT_LIST_HEAD(&sig->cpu_timers[1]);
@@ -955,7 +956,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
955 unsigned long stack_size, 956 unsigned long stack_size,
956 int __user *parent_tidptr, 957 int __user *parent_tidptr,
957 int __user *child_tidptr, 958 int __user *child_tidptr,
958 int pid) 959 struct pid *pid)
959{ 960{
960 int retval; 961 int retval;
961 struct task_struct *p = NULL; 962 struct task_struct *p = NULL;
@@ -1022,7 +1023,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1022 p->did_exec = 0; 1023 p->did_exec = 0;
1023 delayacct_tsk_init(p); /* Must remain after dup_task_struct() */ 1024 delayacct_tsk_init(p); /* Must remain after dup_task_struct() */
1024 copy_flags(clone_flags, p); 1025 copy_flags(clone_flags, p);
1025 p->pid = pid; 1026 p->pid = pid_nr(pid);
1026 retval = -EFAULT; 1027 retval = -EFAULT;
1027 if (clone_flags & CLONE_PARENT_SETTID) 1028 if (clone_flags & CLONE_PARENT_SETTID)
1028 if (put_user(p->pid, parent_tidptr)) 1029 if (put_user(p->pid, parent_tidptr))
@@ -1251,13 +1252,13 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1251 p->signal->tty = current->signal->tty; 1252 p->signal->tty = current->signal->tty;
1252 p->signal->pgrp = process_group(current); 1253 p->signal->pgrp = process_group(current);
1253 set_signal_session(p->signal, process_session(current)); 1254 set_signal_session(p->signal, process_session(current));
1254 attach_pid(p, PIDTYPE_PGID, process_group(p)); 1255 attach_pid(p, PIDTYPE_PGID, task_pgrp(current));
1255 attach_pid(p, PIDTYPE_SID, process_session(p)); 1256 attach_pid(p, PIDTYPE_SID, task_session(current));
1256 1257
1257 list_add_tail_rcu(&p->tasks, &init_task.tasks); 1258 list_add_tail_rcu(&p->tasks, &init_task.tasks);
1258 __get_cpu_var(process_counts)++; 1259 __get_cpu_var(process_counts)++;
1259 } 1260 }
1260 attach_pid(p, PIDTYPE_PID, p->pid); 1261 attach_pid(p, PIDTYPE_PID, pid);
1261 nr_threads++; 1262 nr_threads++;
1262 } 1263 }
1263 1264
@@ -1321,7 +1322,8 @@ struct task_struct * __cpuinit fork_idle(int cpu)
1321 struct task_struct *task; 1322 struct task_struct *task;
1322 struct pt_regs regs; 1323 struct pt_regs regs;
1323 1324
1324 task = copy_process(CLONE_VM, 0, idle_regs(&regs), 0, NULL, NULL, 0); 1325 task = copy_process(CLONE_VM, 0, idle_regs(&regs), 0, NULL, NULL,
1326 &init_struct_pid);
1325 if (!IS_ERR(task)) 1327 if (!IS_ERR(task))
1326 init_idle(task, cpu); 1328 init_idle(task, cpu);
1327 1329
@@ -1371,7 +1373,7 @@ long do_fork(unsigned long clone_flags,
1371 clone_flags |= CLONE_PTRACE; 1373 clone_flags |= CLONE_PTRACE;
1372 } 1374 }
1373 1375
1374 p = copy_process(clone_flags, stack_start, regs, stack_size, parent_tidptr, child_tidptr, nr); 1376 p = copy_process(clone_flags, stack_start, regs, stack_size, parent_tidptr, child_tidptr, pid);
1375 /* 1377 /*
1376 * Do this prior waking up the new thread - the thread pointer 1378 * Do this prior waking up the new thread - the thread pointer
1377 * might get invalid after that point, if the thread exits quickly. 1379 * might get invalid after that point, if the thread exits quickly.
@@ -1420,12 +1422,15 @@ long do_fork(unsigned long clone_flags,
1420#define ARCH_MIN_MMSTRUCT_ALIGN 0 1422#define ARCH_MIN_MMSTRUCT_ALIGN 0
1421#endif 1423#endif
1422 1424
1423static void sighand_ctor(void *data, struct kmem_cache *cachep, unsigned long flags) 1425static void sighand_ctor(void *data, struct kmem_cache *cachep,
1426 unsigned long flags)
1424{ 1427{
1425 struct sighand_struct *sighand = data; 1428 struct sighand_struct *sighand = data;
1426 1429
1427 if (flags & SLAB_CTOR_CONSTRUCTOR) 1430 if (flags & SLAB_CTOR_CONSTRUCTOR) {
1428 spin_lock_init(&sighand->siglock); 1431 spin_lock_init(&sighand->siglock);
1432 INIT_LIST_HEAD(&sighand->signalfd_list);
1433 }
1429} 1434}
1430 1435
1431void __init proc_caches_init(void) 1436void __init proc_caches_init(void)
@@ -1451,7 +1456,6 @@ void __init proc_caches_init(void)
1451 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); 1456 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
1452} 1457}
1453 1458
1454
1455/* 1459/*
1456 * Check constraints on flags passed to the unshare system call and 1460 * Check constraints on flags passed to the unshare system call and
1457 * force unsharing of additional process context as appropriate. 1461 * force unsharing of additional process context as appropriate.
diff --git a/kernel/pid.c b/kernel/pid.c
index d3ad724afa83..eb66bd2953ab 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -27,11 +27,13 @@
27#include <linux/bootmem.h> 27#include <linux/bootmem.h>
28#include <linux/hash.h> 28#include <linux/hash.h>
29#include <linux/pid_namespace.h> 29#include <linux/pid_namespace.h>
30#include <linux/init_task.h>
30 31
31#define pid_hashfn(nr) hash_long((unsigned long)nr, pidhash_shift) 32#define pid_hashfn(nr) hash_long((unsigned long)nr, pidhash_shift)
32static struct hlist_head *pid_hash; 33static struct hlist_head *pid_hash;
33static int pidhash_shift; 34static int pidhash_shift;
34static struct kmem_cache *pid_cachep; 35static struct kmem_cache *pid_cachep;
36struct pid init_struct_pid = INIT_STRUCT_PID;
35 37
36int pid_max = PID_MAX_DEFAULT; 38int pid_max = PID_MAX_DEFAULT;
37 39
@@ -247,13 +249,16 @@ struct pid * fastcall find_pid(int nr)
247} 249}
248EXPORT_SYMBOL_GPL(find_pid); 250EXPORT_SYMBOL_GPL(find_pid);
249 251
250int fastcall attach_pid(struct task_struct *task, enum pid_type type, int nr) 252/*
253 * attach_pid() must be called with the tasklist_lock write-held.
254 */
255int fastcall attach_pid(struct task_struct *task, enum pid_type type,
256 struct pid *pid)
251{ 257{
252 struct pid_link *link; 258 struct pid_link *link;
253 struct pid *pid;
254 259
255 link = &task->pids[type]; 260 link = &task->pids[type];
256 link->pid = pid = find_pid(nr); 261 link->pid = pid;
257 hlist_add_head_rcu(&link->node, &pid->tasks[type]); 262 hlist_add_head_rcu(&link->node, &pid->tasks[type]);
258 263
259 return 0; 264 return 0;
diff --git a/kernel/signal.c b/kernel/signal.c
index c43a3f19d477..364fc95bf97c 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -21,6 +21,7 @@
21#include <linux/syscalls.h> 21#include <linux/syscalls.h>
22#include <linux/ptrace.h> 22#include <linux/ptrace.h>
23#include <linux/signal.h> 23#include <linux/signal.h>
24#include <linux/signalfd.h>
24#include <linux/capability.h> 25#include <linux/capability.h>
25#include <linux/freezer.h> 26#include <linux/freezer.h>
26#include <linux/pid_namespace.h> 27#include <linux/pid_namespace.h>
@@ -113,8 +114,7 @@ void recalc_sigpending(void)
113 114
114/* Given the mask, find the first available signal that should be serviced. */ 115/* Given the mask, find the first available signal that should be serviced. */
115 116
116static int 117int next_signal(struct sigpending *pending, sigset_t *mask)
117next_signal(struct sigpending *pending, sigset_t *mask)
118{ 118{
119 unsigned long i, *s, *m, x; 119 unsigned long i, *s, *m, x;
120 int sig = 0; 120 int sig = 0;
@@ -632,6 +632,12 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
632 int ret = 0; 632 int ret = 0;
633 633
634 /* 634 /*
635 * Deliver the signal to listening signalfds. This must be called
636 * with the sighand lock held.
637 */
638 signalfd_notify(t, sig);
639
640 /*
635 * fast-pathed signals for kernel-internal things like SIGSTOP 641 * fast-pathed signals for kernel-internal things like SIGSTOP
636 * or SIGKILL. 642 * or SIGKILL.
637 */ 643 */
@@ -1282,6 +1288,11 @@ int send_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)
1282 ret = 1; 1288 ret = 1;
1283 goto out; 1289 goto out;
1284 } 1290 }
1291 /*
1292 * Deliver the signal to listening signalfds. This must be called
1293 * with the sighand lock held.
1294 */
1295 signalfd_notify(p, sig);
1285 1296
1286 list_add_tail(&q->list, &p->pending.list); 1297 list_add_tail(&q->list, &p->pending.list);
1287 sigaddset(&p->pending.signal, sig); 1298 sigaddset(&p->pending.signal, sig);
@@ -1325,6 +1336,11 @@ send_group_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)
1325 q->info.si_overrun++; 1336 q->info.si_overrun++;
1326 goto out; 1337 goto out;
1327 } 1338 }
1339 /*
1340 * Deliver the signal to listening signalfds. This must be called
1341 * with the sighand lock held.
1342 */
1343 signalfd_notify(p, sig);
1328 1344
1329 /* 1345 /*
1330 * Put this signal on the shared-pending queue. 1346 * Put this signal on the shared-pending queue.
@@ -1985,6 +2001,8 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from)
1985 /* 2001 /*
1986 * If you change siginfo_t structure, please be sure 2002 * If you change siginfo_t structure, please be sure
1987 * this code is fixed accordingly. 2003 * this code is fixed accordingly.
2004 * Please remember to update the signalfd_copyinfo() function
2005 * inside fs/signalfd.c too, in case siginfo_t changes.
1988 * It should never copy any pad contained in the structure 2006 * It should never copy any pad contained in the structure
1989 * to avoid security leaks, but must copy the generic 2007 * to avoid security leaks, but must copy the generic
1990 * 3 ints plus the relevant union member. 2008 * 3 ints plus the relevant union member.
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index daabb74ee0bc..fcee2a8e6da3 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -8,6 +8,8 @@
8#include <linux/sched.h> 8#include <linux/sched.h>
9#include <linux/stop_machine.h> 9#include <linux/stop_machine.h>
10#include <linux/syscalls.h> 10#include <linux/syscalls.h>
11#include <linux/interrupt.h>
12
11#include <asm/atomic.h> 13#include <asm/atomic.h>
12#include <asm/semaphore.h> 14#include <asm/semaphore.h>
13#include <asm/uaccess.h> 15#include <asm/uaccess.h>
@@ -45,6 +47,7 @@ static int stopmachine(void *cpu)
45 if (stopmachine_state == STOPMACHINE_DISABLE_IRQ 47 if (stopmachine_state == STOPMACHINE_DISABLE_IRQ
46 && !irqs_disabled) { 48 && !irqs_disabled) {
47 local_irq_disable(); 49 local_irq_disable();
50 hard_irq_disable();
48 irqs_disabled = 1; 51 irqs_disabled = 1;
49 /* Ack: irqs disabled. */ 52 /* Ack: irqs disabled. */
50 smp_mb(); /* Must read state first. */ 53 smp_mb(); /* Must read state first. */
@@ -124,6 +127,7 @@ static int stop_machine(void)
124 127
125 /* Make them disable irqs. */ 128 /* Make them disable irqs. */
126 local_irq_disable(); 129 local_irq_disable();
130 hard_irq_disable();
127 stopmachine_set_state(STOPMACHINE_DISABLE_IRQ); 131 stopmachine_set_state(STOPMACHINE_DISABLE_IRQ);
128 132
129 return 0; 133 return 0;
diff --git a/kernel/sys.c b/kernel/sys.c
index cdb7e9457ba6..872271ccc384 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -14,6 +14,7 @@
14#include <linux/prctl.h> 14#include <linux/prctl.h>
15#include <linux/highuid.h> 15#include <linux/highuid.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/resource.h>
17#include <linux/kernel.h> 18#include <linux/kernel.h>
18#include <linux/kexec.h> 19#include <linux/kexec.h>
19#include <linux/workqueue.h> 20#include <linux/workqueue.h>
@@ -29,6 +30,7 @@
29#include <linux/signal.h> 30#include <linux/signal.h>
30#include <linux/cn_proc.h> 31#include <linux/cn_proc.h>
31#include <linux/getcpu.h> 32#include <linux/getcpu.h>
33#include <linux/task_io_accounting_ops.h>
32 34
33#include <linux/compat.h> 35#include <linux/compat.h>
34#include <linux/syscalls.h> 36#include <linux/syscalls.h>
@@ -658,7 +660,7 @@ asmlinkage long sys_setpriority(int which, int who, int niceval)
658 int error = -EINVAL; 660 int error = -EINVAL;
659 struct pid *pgrp; 661 struct pid *pgrp;
660 662
661 if (which > 2 || which < 0) 663 if (which > PRIO_USER || which < PRIO_PROCESS)
662 goto out; 664 goto out;
663 665
664 /* normalize: avoid signed division (rounding problems) */ 666 /* normalize: avoid signed division (rounding problems) */
@@ -722,7 +724,7 @@ asmlinkage long sys_getpriority(int which, int who)
722 long niceval, retval = -ESRCH; 724 long niceval, retval = -ESRCH;
723 struct pid *pgrp; 725 struct pid *pgrp;
724 726
725 if (which > 2 || which < 0) 727 if (which > PRIO_USER || which < PRIO_PROCESS)
726 return -EINVAL; 728 return -EINVAL;
727 729
728 read_lock(&tasklist_lock); 730 read_lock(&tasklist_lock);
@@ -1486,7 +1488,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
1486 if (process_group(p) != pgid) { 1488 if (process_group(p) != pgid) {
1487 detach_pid(p, PIDTYPE_PGID); 1489 detach_pid(p, PIDTYPE_PGID);
1488 p->signal->pgrp = pgid; 1490 p->signal->pgrp = pgid;
1489 attach_pid(p, PIDTYPE_PGID, pgid); 1491 attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
1490 } 1492 }
1491 1493
1492 err = 0; 1494 err = 0;
@@ -2082,6 +2084,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
2082 r->ru_nivcsw = p->signal->cnivcsw; 2084 r->ru_nivcsw = p->signal->cnivcsw;
2083 r->ru_minflt = p->signal->cmin_flt; 2085 r->ru_minflt = p->signal->cmin_flt;
2084 r->ru_majflt = p->signal->cmaj_flt; 2086 r->ru_majflt = p->signal->cmaj_flt;
2087 r->ru_inblock = p->signal->cinblock;
2088 r->ru_oublock = p->signal->coublock;
2085 2089
2086 if (who == RUSAGE_CHILDREN) 2090 if (who == RUSAGE_CHILDREN)
2087 break; 2091 break;
@@ -2093,6 +2097,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
2093 r->ru_nivcsw += p->signal->nivcsw; 2097 r->ru_nivcsw += p->signal->nivcsw;
2094 r->ru_minflt += p->signal->min_flt; 2098 r->ru_minflt += p->signal->min_flt;
2095 r->ru_majflt += p->signal->maj_flt; 2099 r->ru_majflt += p->signal->maj_flt;
2100 r->ru_inblock += p->signal->inblock;
2101 r->ru_oublock += p->signal->oublock;
2096 t = p; 2102 t = p;
2097 do { 2103 do {
2098 utime = cputime_add(utime, t->utime); 2104 utime = cputime_add(utime, t->utime);
@@ -2101,6 +2107,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
2101 r->ru_nivcsw += t->nivcsw; 2107 r->ru_nivcsw += t->nivcsw;
2102 r->ru_minflt += t->min_flt; 2108 r->ru_minflt += t->min_flt;
2103 r->ru_majflt += t->maj_flt; 2109 r->ru_majflt += t->maj_flt;
2110 r->ru_inblock += task_io_get_inblock(t);
2111 r->ru_oublock += task_io_get_oublock(t);
2104 t = next_thread(t); 2112 t = next_thread(t);
2105 } while (t != p); 2113 } while (t != p);
2106 break; 2114 break;
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index d7306d0f3dfc..b6d77a8a1ca9 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -141,3 +141,8 @@ cond_syscall(compat_sys_migrate_pages);
141cond_syscall(sys_bdflush); 141cond_syscall(sys_bdflush);
142cond_syscall(sys_ioprio_set); 142cond_syscall(sys_ioprio_set);
143cond_syscall(sys_ioprio_get); 143cond_syscall(sys_ioprio_get);
144
145/* New file descriptors */
146cond_syscall(sys_signalfd);
147cond_syscall(sys_timerfd);
148cond_syscall(sys_eventfd);