Commit 4fbceca
committed
Cygwin: signal: Clear direction flag in sigdeleyed
x86_64 ABI requires the direction flag in CPU flags register cleared.
https://learn.microsoft.com/en-us/cpp/build/x64-software-conventions
However, currently that flag is not maintained in signal handler.
Therefore, if the signal handler is called when that flag is set, it
destroys the data and may crash if rep instruction is used in the
signal handler. With this patch, the direction flag is cleared in
sigdelayed() by adding cld instruction.
Backported-from: d71aecc (Cygwin: signal: Clear direction flag in sigdeleyed, 2025-03-24)
Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257704.html
Fixes: 1fd5e00 ("import winsup-2000-02-17 snapshot")
Reported-by: Christian Franke <[email protected]>
Reviewed-by: Corinna Vischen <[email protected]>
Signed-off-by: Takashi Yano <[email protected]>
(cherry picked from commit 9f4cec47df66a913256912c358afe5e597dec25c)
Signed-off-by: Johannes Schindelin <[email protected]>1 parent 5c97a05 commit 4fbceca
2 files changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
0 commit comments