[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] linux-user: Add syscall dispatch support
From: |
Ilya Leoshkevich |
Subject: |
Re: [PATCH] linux-user: Add syscall dispatch support |
Date: |
Thu, 16 Jan 2025 00:45:01 +0100 |
User-agent: |
Evolution 3.52.4 (3.52.4-2.fc40) |
On Wed, 2025-01-15 at 15:36 +0100, Arusekk via wrote:
> This commit adds support for the `prctl(PR_SET_SYSCALL_DISPATCH)`
> function in the Linux userspace emulator.
Typo: this should be PR_SET_SYSCALL_USER_DISPATCH.
> 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.
>
> Tested on [uglendix][1], will probably also apply to recent versions
> of
> Wine that use syscall dispatch.
>
> [1]: https://sr.ht/~arusekk/uglendix
>
> Signed-off-by: Arusekk <floss@arusekk.pl>
> ---
> linux-user/main.c | 2 ++
> linux-user/qemu.h | 5 +++
> linux-user/syscall.c | 64
> ++++++++++++++++++++++++++++++++++++++-
> linux-user/syscall_defs.h | 6 ++++
> 4 files changed, 76 insertions(+), 1 deletion(-)
[...]
> @@ -13852,12 +13886,34 @@ static abi_long do_syscall1(CPUArchState
> *cpu_env, int num, abi_long arg1,
> return ret;
> }
>
> +static bool sys_dispatch(abi_ulong pc, TaskState *ts)
> +{
What about this line from the kernel implementation?
if (unlikely(arch_syscall_is_vdso_sigreturn(regs)))
return false;
I think qemu's vdso implements sigreturn, e.g., in
linux-user/arm/vdso.S.
[...]