Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
3
-
9223372036854775807
Description
When HAVE_FORCE_SIG_WITH_TASK is not available cfs_force_sig() is used.
However cfs_force_sig holds a spin lock on 'siglock':
#define cfs_force_sig(sig, task) \ do { \ unsigned long flags;\ \ spin_lock_irqsave(&task->sighand->siglock, flags);\ task->sighand->action[sig - 1].sa.sa_handler = SIG_DFL;\ send_sig(sig, task, 1);\ spin_unlock_irqrestore(&task->sighand->siglock, flags); \ } while (0)
This causes a dead lock on 'siglock' as do_send_sig_info also takes the same lock.
cfs_force_sig(sig, task) -> spin_lock_irqsave(&task->sighand->siglock, flags); \ -> send_sig(.., task,..) -> send_sig_info(.., task) -> do_send_sig_info(..., task) -> lock_task_sighand(task) -> __lock_task_sighand(task, flags) { sighand = rcu_dereference(task->sighand); spin_lock_irqsave(&sighand->siglock, *flags); ... }
cfs_force_sig() should release the spin lock before calling send_sig()