1
0
mirror of https://github.com/containers/buildah.git synced 2026-02-05 09:45:38 +01:00

run: drop Pdeathsig

it is not safe to use prctl(PR_SET_PDEATHSIG) in a Go program since
the parent of the process is considered the *thread* that created the
child process, and the Go runtime can free a thread at any time.   We
would either need to lock the thread, or simpler just not use it.

[NO NEW TESTS NEEDED]

Closes: https://github.com/containers/podman/issues/17918

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2023-05-11 21:00:49 +02:00
parent e8d11201a9
commit 0eb266a958
3 changed files with 0 additions and 22 deletions

View File

@@ -7,10 +7,8 @@ import (
"errors"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"syscall"
"unsafe"
"github.com/containers/buildah/bind"
@@ -531,14 +529,6 @@ func addRlimits(ulimit []string, g *generate.Generator, defaultUlimits []string)
return nil
}
// setPdeathsig sets a parent-death signal for the process
func setPdeathsig(cmd *exec.Cmd) {
if cmd.SysProcAttr == nil {
cmd.SysProcAttr = &syscall.SysProcAttr{}
}
cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL
}
// Create pipes to use for relaying stdio.
func runMakeStdioPipe(uid, gid int) ([][]int, error) {
stdioPipe := make([][]int, 3)