aboutsummaryrefslogtreecommitdiff
path: root/src/signal/mipsn32
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2023-02-09 11:52:44 -0500
committerRich Felker <dalias@aerifal.cx>2023-02-09 12:33:35 -0500
commit269d193820342dc109f39909d78fb30f4c978f76 (patch)
tree2acbae503e21dca93feb669b5d5a890ee915a797 /src/signal/mipsn32
parentea3b40a321e751e016948087ef23ae7b9e8e0150 (diff)
downloadmusl-269d193820342dc109f39909d78fb30f4c978f76.zip
musl-269d193820342dc109f39909d78fb30f4c978f76.tar.gz
musl-269d193820342dc109f39909d78fb30f4c978f76.tar.bz2
fix wrong sigaction syscall ABI on mips*, or1k, microblaze, riscv64
we wrongly defined a dummy SA_RESTORER flag on these archs, despite the kernel interface not actually having such a feature. on archs which lack SA_RESTORER, the kernel sigaction structure also lacks the restorer function pointer member, which means the signal mask appears at a different offset. the kernel was thereby interpreting the bits of the code address as part of the signal set to be masked while handling the signal. this patch removes the erroneous SA_RESTORER definitions from archs which do not have it, makes access to the member conditional on whether SA_RESTORER is defined for the arch, and removes the now-unused asm for the affected archs. because there are reportedly versions of qemu-user which also use the wrong ABI here, the old ksigaction struct size is preserved with an unused member at the end. this is harmless and mitigates the risk of such a bug turning into a buffer overflow onto the sigaction function's stack.
Diffstat (limited to 'src/signal/mipsn32')
-rw-r--r--src/signal/mipsn32/restore.s11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/signal/mipsn32/restore.s b/src/signal/mipsn32/restore.s
deleted file mode 100644
index 4cd4e1b..0000000
--- a/src/signal/mipsn32/restore.s
+++ /dev/null
@@ -1,11 +0,0 @@
-.set noreorder
-.global __restore_rt
-.global __restore
-.hidden __restore_rt
-.hidden __restore
-.type __restore_rt,@function
-.type __restore,@function
-__restore_rt:
-__restore:
- li $2,6211
- syscall