diff options
Diffstat (limited to 'kernel/signal.c')
| -rw-r--r-- | kernel/signal.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 86c32b884f8e..415d85d6f6c6 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
| @@ -1178,18 +1178,25 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, | |||
| 1178 | { | 1178 | { |
| 1179 | struct sighand_struct *sighand; | 1179 | struct sighand_struct *sighand; |
| 1180 | 1180 | ||
| 1181 | rcu_read_lock(); | ||
| 1182 | for (;;) { | 1181 | for (;;) { |
| 1182 | local_irq_save(*flags); | ||
| 1183 | rcu_read_lock(); | ||
| 1183 | sighand = rcu_dereference(tsk->sighand); | 1184 | sighand = rcu_dereference(tsk->sighand); |
| 1184 | if (unlikely(sighand == NULL)) | 1185 | if (unlikely(sighand == NULL)) { |
| 1186 | rcu_read_unlock(); | ||
| 1187 | local_irq_restore(*flags); | ||
| 1185 | break; | 1188 | break; |
| 1189 | } | ||
| 1186 | 1190 | ||
| 1187 | spin_lock_irqsave(&sighand->siglock, *flags); | 1191 | spin_lock(&sighand->siglock); |
| 1188 | if (likely(sighand == tsk->sighand)) | 1192 | if (likely(sighand == tsk->sighand)) { |
| 1193 | rcu_read_unlock(); | ||
| 1189 | break; | 1194 | break; |
| 1190 | spin_unlock_irqrestore(&sighand->siglock, *flags); | 1195 | } |
| 1196 | spin_unlock(&sighand->siglock); | ||
| 1197 | rcu_read_unlock(); | ||
| 1198 | local_irq_restore(*flags); | ||
| 1191 | } | 1199 | } |
| 1192 | rcu_read_unlock(); | ||
| 1193 | 1200 | ||
| 1194 | return sighand; | 1201 | return sighand; |
| 1195 | } | 1202 | } |
| @@ -2365,7 +2372,7 @@ int sigprocmask(int how, sigset_t *set, sigset_t *oldset) | |||
| 2365 | /** | 2372 | /** |
| 2366 | * sys_rt_sigprocmask - change the list of currently blocked signals | 2373 | * sys_rt_sigprocmask - change the list of currently blocked signals |
| 2367 | * @how: whether to add, remove, or set signals | 2374 | * @how: whether to add, remove, or set signals |
| 2368 | * @set: stores pending signals | 2375 | * @nset: stores pending signals |
| 2369 | * @oset: previous value of signal mask if non-null | 2376 | * @oset: previous value of signal mask if non-null |
| 2370 | * @sigsetsize: size of sigset_t type | 2377 | * @sigsetsize: size of sigset_t type |
| 2371 | */ | 2378 | */ |
