From 49f9c2d289d546c97aae87130574abe5b963b72a Mon Sep 17 00:00:00 2001 From: Sabyrzhan Tasbolatov Date: Tue, 17 Sep 2024 01:10:32 +0500 Subject: pkg/build: handle OOM-killed build error Handle SIGKILL (exit code = 137) on osutil.Run() during Linux kernel image building and return build.InfraError without reporting. Fixes: https://github.com/google/syzkaller/issues/5317 --- pkg/osutil/osutil.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/osutil') diff --git a/pkg/osutil/osutil.go b/pkg/osutil/osutil.go index a619f9169..465679ced 100644 --- a/pkg/osutil/osutil.go +++ b/pkg/osutil/osutil.go @@ -68,7 +68,7 @@ func Run(timeout time.Duration, cmd *exec.Cmd) ([]byte, error) { if <-timedout { text = fmt.Sprintf("timedout after %v %q", timeout, cmd.Args) } - exitCode := 0 + exitCode := cmd.ProcessState.ExitCode() var exitErr *exec.ExitError if errors.As(err, &exitErr) { if status, ok := exitErr.Sys().(syscall.WaitStatus); ok { -- cgit mrf-deployment