Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test patch
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
crazy-max committed May 11, 2023

Verified

This commit was signed with the committer’s verified signature.
crazy-max CrazyMax
1 parent 7d276ea commit 6b66ebd
Showing 3 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ ARG QEMU_REPO
RUN git clone $QEMU_REPO && cd qemu && git checkout $QEMU_VERSION
COPY patches patches
# QEMU_PATCHES defines additional patches to apply before compilation
ARG QEMU_PATCHES=cpu-max
ARG QEMU_PATCHES=cpu-max,subreaper-prctl
# QEMU_PATCHES_ALL defines all patches to apply before compilation
ARG QEMU_PATCHES_ALL=${QEMU_PATCHES},alpine-patches
ARG QEMU_PRESERVE_ARGV0
2 changes: 1 addition & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ variable "QEMU_VERSION" {
default = "v7.1.0"
}
variable "QEMU_PATCHES" {
default = "cpu-max"
default = "cpu-max,subreaper-prctl"
}

// Special target: https://github.com/docker/metadata-action#bake-definition
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From fb2d9448acae73a193aede5b6c966e2e578987e6 Mon Sep 17 00:00:00 2001
From: CrazyMax <crazy-max@users.noreply.github.com>
Date: Thu, 11 May 2023 18:23:03 +0200
Subject: [PATCH] linux-user: pass SUBREAPER to prctl

Reaper status can be aquired by using prctl() with
PR_*_CHILD_SUBREAPER on linux. Signal will be delivered
to every descendant process.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
---
linux-user/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b8a75f35d2..4c66d9fe37 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6548,11 +6548,11 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
case PR_SET_NO_NEW_PRIVS:
case PR_GET_IO_FLUSHER:
case PR_SET_IO_FLUSHER:
+ case PR_GET_CHILD_SUBREAPER:
+ case PR_SET_CHILD_SUBREAPER:
/* Some prctl options have no pointer arguments and we can pass on. */
return get_errno(prctl(option, arg2, arg3, arg4, arg5));

- case PR_GET_CHILD_SUBREAPER:
- case PR_SET_CHILD_SUBREAPER:
case PR_GET_SPECULATION_CTRL:
case PR_SET_SPECULATION_CTRL:
case PR_GET_TID_ADDRESS:
--
2.34.0

0 comments on commit 6b66ebd

Please sign in to comment.