Commit 78dce99
md: don't use flush_signals in userspace processes
commit f9c79bc05a2a91f4fba8bfd653579e066714b1ec upstream.
The function flush_signals clears all pending signals for the process. It
may be used by kernel threads when we need to prepare a kernel thread for
responding to signals. However using this function for an userspaces
processes is incorrect - clearing signals without the program expecting it
can cause misbehavior.
The raid1 and raid5 code uses flush_signals in its request routine because
it wants to prepare for an interruptible wait. This patch drops
flush_signals and uses sigprocmask instead to block all signals (including
SIGKILL) around the schedule() call. The signals are not lost, but the
schedule() call won't respond to them.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 9b989b4 commit 78dce99
2 files changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1088 | 1088 | | |
1089 | 1089 | | |
1090 | 1090 | | |
1091 | | - | |
| 1091 | + | |
1092 | 1092 | | |
1093 | 1093 | | |
1094 | 1094 | | |
| |||
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| 1100 | + | |
| 1101 | + | |
1100 | 1102 | | |
| 1103 | + | |
1101 | 1104 | | |
1102 | 1105 | | |
1103 | 1106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5279 | 5279 | | |
5280 | 5280 | | |
5281 | 5281 | | |
5282 | | - | |
5283 | 5282 | | |
5284 | 5283 | | |
5285 | 5284 | | |
5286 | 5285 | | |
| 5286 | + | |
| 5287 | + | |
| 5288 | + | |
5287 | 5289 | | |
| 5290 | + | |
5288 | 5291 | | |
5289 | 5292 | | |
5290 | 5293 | | |
| |||
0 commit comments