Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/exec: Plan 9 build has been broken by a Windows security fix (also breaks 1.19.3 and 1.18.8) #56544

Closed
millerresearch opened this issue Nov 3, 2022 · 9 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Plan9 Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations)
Milestone

Comments

@millerresearch
Copy link
Contributor

CL 446915 fixes a security vulnerability on Windows (#56284), by rejecting environment variables containing NUL in os/exec.Cmd. In Plan 9, NULs in environment variables are not only permitted but required: the path variable uses NUL as the os.PathListSeparator character. Since the environment almost always contains path, this effectively breaks os/exec, on which go build depends.

The change has already been back-ported to 1.19.3 and 1.18.8, so those releases also won't build for Plan 9.

Plan 9 does not exhibit the vulnerability to NULs because it implements environment variables in a completely different way.

Therefore we could safely correct this issue by making the rejection of NUL conditional on runtime.GOOS != "plan9" or on os.PathListSeparator != '\000'.

@mdempsky mdempsky added NeedsFix The path to resolution is known, but the work has not been done. Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations) labels Nov 3, 2022
@mdempsky
Copy link
Contributor

mdempsky commented Nov 3, 2022

@gopherbot Please backport to 1.18 and 1.19. The Windows security fix inadvertently broke Plan 9.

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #56550 (for 1.18), #56551 (for 1.19).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/447715 mentions this issue: os/exec: allow NUL in environment variables on Plan 9

@mdempsky
Copy link
Contributor

mdempsky commented Nov 3, 2022

/cc @golang/plan9 for FYI

@rsc
Copy link
Contributor

rsc commented Nov 3, 2022

If we can get a Plan 9 builder (either 386 or amd64) running on GCP VMs again, that would help with being able to run the Plan 9 tests in advance of security releases. That's #29801.

@dmitshur dmitshur added this to the Go1.20 milestone Nov 3, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/447875 mentions this issue: [release-branch.go1.18] os/exec: allow NUL in environment variables on Plan 9

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/447799 mentions this issue: [release-branch.go1.19] os/exec: allow NUL in environment variables on Plan 9

@millerresearch
Copy link
Contributor Author

If we can get a Plan 9 builder (either 386 or amd64) running on GCP VMs again, that would help with being able to run the Plan 9 tests in advance of security releases. That's #29801.

Suppose the plan9-arm builder could run on AWS arm bare-metal, would that be an acceptable alternative?

@millerresearch
Copy link
Contributor Author

Suppose the plan9-arm builder could run on AWS arm bare-metal, would that be an acceptable alternative?

As an alternative alternative, one (physical) raspberry pi in the reverse-dial plan9-arm cluster (in my house) could be kept in reserve for explicitly requested slowbot runs, so those wouldn't have to be queued up behind the normal trybot runs from every new CL. Is there a way to configure that in the coordinator? I guess using a separate builder name would work.

gopherbot pushed a commit that referenced this issue Nov 9, 2022
…n Plan 9

Plan 9 uses NUL as os.PathListSeparator, so it's almost always going
to appear in the environment variable list. Exempt GOOS=plan9 from the
check for NUL in environment variables.

For #56284.
For #56544.
Fixes #56550.

Change-Id: I23df233cdf20c0a9a606fd9253e15a9b5482575a
Reviewed-on: https://go-review.googlesource.com/c/go/+/447715
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/447875
Run-TryBot: David du Colombier <0intro@gmail.com>
gopherbot pushed a commit that referenced this issue Nov 9, 2022
…n Plan 9

Plan 9 uses NUL as os.PathListSeparator, so it's almost always going
to appear in the environment variable list. Exempt GOOS=plan9 from the
check for NUL in environment variables.

For #56284.
For #56544.
Fixes #56551.

Change-Id: I23df233cdf20c0a9a606fd9253e15a9b5482575a
Reviewed-on: https://go-review.googlesource.com/c/go/+/447715
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/447799
Run-TryBot: David du Colombier <0intro@gmail.com>
andrew-d pushed a commit to tailscale/go that referenced this issue Dec 7, 2022
…n Plan 9

Plan 9 uses NUL as os.PathListSeparator, so it's almost always going
to appear in the environment variable list. Exempt GOOS=plan9 from the
check for NUL in environment variables.

For golang#56284.
For golang#56544.
Fixes golang#56551.

Change-Id: I23df233cdf20c0a9a606fd9253e15a9b5482575a
Reviewed-on: https://go-review.googlesource.com/c/go/+/447715
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/447799
Run-TryBot: David du Colombier <0intro@gmail.com>
@golang golang locked and limited conversation to collaborators Nov 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Plan9 Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations)
Projects
None yet
Development

No branches or pull requests

5 participants