diff options
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 2ac3a668d9dd..34b7d6abce8f 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 | ||
116 | static int | 117 | int next_signal(struct sigpending *pending, sigset_t *mask) |
117 | next_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; |
@@ -630,6 +630,12 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t, | |||
630 | int ret = 0; | 630 | int ret = 0; |
631 | 631 | ||
632 | /* | 632 | /* |
633 | * Deliver the signal to listening signalfds. This must be called | ||
634 | * with the sighand lock held. | ||
635 | */ | ||
636 | signalfd_notify(t, sig); | ||
637 | |||
638 | /* | ||
633 | * fast-pathed signals for kernel-internal things like SIGSTOP | 639 | * fast-pathed signals for kernel-internal things like SIGSTOP |
634 | * or SIGKILL. | 640 | * or SIGKILL. |
635 | */ | 641 | */ |
@@ -1280,6 +1286,11 @@ int send_sigqueue(int sig, struct sigqueue *q, struct task_struct *p) | |||
1280 | ret = 1; | 1286 | ret = 1; |
1281 | goto out; | 1287 | goto out; |
1282 | } | 1288 | } |
1289 | /* | ||
1290 | * Deliver the signal to listening signalfds. This must be called | ||
1291 | * with the sighand lock held. | ||
1292 | */ | ||
1293 | signalfd_notify(p, sig); | ||
1283 | 1294 | ||
1284 | list_add_tail(&q->list, &p->pending.list); | 1295 | list_add_tail(&q->list, &p->pending.list); |
1285 | sigaddset(&p->pending.signal, sig); | 1296 | sigaddset(&p->pending.signal, sig); |
@@ -1323,6 +1334,11 @@ send_group_sigqueue(int sig, struct sigqueue *q, struct task_struct *p) | |||
1323 | q->info.si_overrun++; | 1334 | q->info.si_overrun++; |
1324 | goto out; | 1335 | goto out; |
1325 | } | 1336 | } |
1337 | /* | ||
1338 | * Deliver the signal to listening signalfds. This must be called | ||
1339 | * with the sighand lock held. | ||
1340 | */ | ||
1341 | signalfd_notify(p, sig); | ||
1326 | 1342 | ||
1327 | /* | 1343 | /* |
1328 | * Put this signal on the shared-pending queue. | 1344 | * Put this signal on the shared-pending queue. |
@@ -1983,6 +1999,8 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from) | |||
1983 | /* | 1999 | /* |
1984 | * If you change siginfo_t structure, please be sure | 2000 | * If you change siginfo_t structure, please be sure |
1985 | * this code is fixed accordingly. | 2001 | * this code is fixed accordingly. |
2002 | * Please remember to update the signalfd_copyinfo() function | ||
2003 | * inside fs/signalfd.c too, in case siginfo_t changes. | ||
1986 | * It should never copy any pad contained in the structure | 2004 | * It should never copy any pad contained in the structure |
1987 | * to avoid security leaks, but must copy the generic | 2005 | * to avoid security leaks, but must copy the generic |
1988 | * 3 ints plus the relevant union member. | 2006 | * 3 ints plus the relevant union member. |