-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from crazy-max/e2e-tini
pass SUBREAPER to prctl patch and new desktop flavor
- Loading branch information
Showing
4 changed files
with
97 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
patches/subreaper-prctl/0001-linux-user-pass-SUBREAPER-to-prctl.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG TINI_VERSION="v0.19.0" | ||
|
||
FROM alpine:3.17 | ||
RUN apk add --no-cache file wget | ||
ARG TINI_VERSION | ||
ARG TARGETPLATFORM | ||
RUN <<EOT | ||
TINI_ARCH=$(case ${TARGETPLATFORM} in | ||
"linux/amd64") echo "amd64" ;; | ||
"linux/arm/v6") echo "armel" ;; | ||
"linux/arm/v7") echo "armhf" ;; | ||
"linux/arm64") echo "arm64" ;; | ||
"linux/ppc64le") echo "ppc64le" ;; | ||
"linux/s390x") echo "390x" ;; | ||
*) echo "" ;; esac) | ||
wget -q "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TINI_ARCH}" -qO /tini | ||
chmod +x /tini | ||
file /tini | ||
EOT | ||
CMD [ "/tini", "-s", "--", "uname", "-a" ] |