diff options
| author | Arusekk <floss@arusekk.pl> | 2025-07-11 18:48:29 +0200 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2025-09-23 16:17:59 -0700 |
| commit | c8e5aed246914ff6438839350e414a3bea5a8041 (patch) | |
| tree | 7ce1d83c81e0014ec6644bda93cef60a48e6bbbe /linux-user/signal-common.h | |
| parent | 2c75137623cb60f2ac3cedfff077d00dc977b842 (diff) | |
| download | focaccia-qemu-c8e5aed246914ff6438839350e414a3bea5a8041.tar.gz focaccia-qemu-c8e5aed246914ff6438839350e414a3bea5a8041.zip | |
linux-user: Add syscall dispatch support
This commit adds support for the `prctl(PR_SET_SYSCALL_USER_DISPATCH)` function in the Linux userspace emulator. It is implemented as a fully host-independent function, by forcing a SIGSYS early during syscall handling, if the PC is outside the allowed range. Since disabled SUD is indistinguishable from enabled SUD with always-allowed region length == ~0, this encoding is used instead of introducing a new flag. Tested on [uglendix][1], will probably also apply to software like tiny-wine, rpcsx, limbo, lazypoline, vicar, sysfail and endokernel, to name a few. [1]: https://sr.ht/~arusekk/uglendix Signed-off-by: Arusekk <floss@arusekk.pl> Message-ID: <20250711225226.14652-1-floss@arusekk.pl> [rth: Split out is_vdso_sigreturn region matching and other minor tweaks.] Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/signal-common.h')
| -rw-r--r-- | linux-user/signal-common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/linux-user/signal-common.h b/linux-user/signal-common.h index 0b04868727..8a44714251 100644 --- a/linux-user/signal-common.h +++ b/linux-user/signal-common.h @@ -28,6 +28,11 @@ extern abi_ulong default_rt_sigreturn; extern abi_ulong vdso_sigreturn_region_start; extern abi_ulong vdso_sigreturn_region_end; +static inline bool is_vdso_sigreturn(abi_ulong pc) +{ + return pc >= vdso_sigreturn_region_start && pc < vdso_sigreturn_region_end; +} + void setup_sigtramp(abi_ulong tramp_page); int on_sig_stack(unsigned long sp); |