[LU-16893] Fix cfs_force_sig(sig, task) deadlock on 5.3 and later kernels. Created: 14/Jun/23 Updated: 02/Aug/23 Resolved: 26/Jul/23 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Upstream |
| Type: | Bug | Priority: | Minor |
| Reporter: | Shaun Tancheff | Assignee: | Shaun Tancheff |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Severity: | 3 |
| Rank (Obsolete): | 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() |
| Comments |
| Comment by Gerrit Updater [ 14/Jun/23 ] |
|
"Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51312 |
| Comment by Gerrit Updater [ 27/Jun/23 ] |
|
"Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51470 |
| Comment by Gerrit Updater [ 19/Jul/23 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51470/ |
| Comment by Shaun Tancheff [ 26/Jul/23 ] |
|
Issue is resolved on master |
| Comment by Gerrit Updater [ 02/Aug/23 ] |
|
"xinliang <xinliang.liu@linaro.org>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51848 |