Skip to content

user: add runtime switch to call safe_syscall via libc

Balint Reczey qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 1 patch 0 repliesNew

Patches in v1 No applies recorded yet

The patch the cover letter announces is not in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] user: add runtime switch to call safe_syscall via libc

Hi,

qemu-user implements calling signal-race-safe syscalls for the guest in assembly directly to the kernel instead of going through the host's libc.

The proposed patch adds a switch to go through libc, which allows interposition of libc's syscall(), even when the guest program is statically linked.

The motivation behind the change is intercepting statically linked binaries [1] with firebuild [2], a build accelerator implemented in userspace.

I have tested the Linux changes, but not not BSD ones.
I think they are trivial enough to work and I'd like to port firebuild to BSD, too, in the future.

Cheers,
Balint

[1] https://github.com/firebuild/firebuild/pull/1334
[2] https://github.com/firebuild/firebuild

Balint Reczey (1):
user: add runtime switch to call safe_syscall via libc

 bsd-user/main.c             | 11 +++++++
 common-user/meson.build     |  1 +
 common-user/safe-syscall.c  | 57 +++++++++++++++++++++++++++++++++++++
 docs/user/main.rst          | 28 ++++++++++++++++--
 include/user/safe-syscall.h | 25 +++++++++++-----
 linux-user/main.c           |  9 ++++++
 6 files changed, 122 insertions(+), 9 deletions(-)
 create mode 100644 common-user/safe-syscall.c
Signature · 1 line
2.43.0