CVE-2021-44717
authorGo Compiler Team <pkg-golang-devel@lists.alioth.debian.org>
Tue, 26 Apr 2022 17:32:45 +0000 (18:32 +0100)
committerSylvain Beucler <beuc@debian.org>
Tue, 26 Apr 2022 17:32:45 +0000 (18:32 +0100)
commitd1d0ab334496b12c5217e303ead4a8a1b3bfc0c5
tree66d80a1039b3a791f331e5f5ac8abea7aa1a410f
parent143bfcf95368c1fd23c3c511d39fd5669596f24b
CVE-2021-44717

Origin: https://github.com/golang/go/commit/44a3fb49d99cc8a4de4925b69650f97bb07faf1d
Reviewed-by: Sylvain Beucler <beuc@debian.org>
Last-Update: 2022-01-21

From 44a3fb49d99cc8a4de4925b69650f97bb07faf1d Mon Sep 17 00:00:00 2001
From: Russ Cox <rsc@golang.org>
Date: Wed, 8 Dec 2021 18:05:11 -0500
Subject: [PATCH] [release-branch.go1.16] syscall: fix ForkLock spurious
 close(0) on pipe failure

Pipe (and therefore forkLockPipe) does not make any guarantees
about the state of p after a failed Pipe(p). Avoid that assumption
and the too-clever goto, so that we don't accidentally Close a real fd
if the failed pipe leaves p[0] or p[1] set >= 0.

Updates #50057
Fixes CVE-2021-44717

Change-Id: Iff8e19a6efbba0c73cc8b13ecfae381c87600bb4
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1291270
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/370514
Trust: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Gbp-Pq: Name CVE-2021-44717.patch
src/syscall/exec_unix.go