util/linuxfw: remove yet-unused code to fix linux/arm64 crash

The util/linuxfw/iptables.go had a bunch of code that wasn't yet used
(in prep for future work) but because of its imports, ended up
initializing code deep within gvisor that panicked on init on arm64
systems not using 4KB pages.

This deletes the unused code to delete the imports and remove the
panic. We can then cherry-pick this back to the branch and restore it
later in a different way.

A new test makes sure we don't regress in the future by depending on
the panicking package in question.

Fixes #8658

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2023-07-20 20:36:12 -07:00
committed by Brad Fitzpatrick
parent 7560435eb5
commit 88cc0ad9f7
6 changed files with 11 additions and 863 deletions

View File

@@ -20,17 +20,15 @@ func TestDeps(t *testing.T) {
GOOS: "darwin",
GOARCH: "arm64",
BadDeps: map[string]string{
"gvisor.dev/gvisor/pkg/hostarch": "will crash on non-4K page sizes",
"gvisor.dev/gvisor/pkg/hostarch": "will crash on non-4K page sizes; see https://github.com/tailscale/tailscale/issues/8658",
},
}.Check(t)
deptest.DepChecker{
GOOS: "linux",
GOARCH: "arm64",
GOOS: "linux",
GOARCH: "arm64",
BadDeps: map[string]string{
// TODO: per https://github.com/tailscale/tailscale/issues/8658,
// add this line too:
// "gvisor.dev/gvisor/pkg/hostarch": "will crash on non-4K page sizes",
"gvisor.dev/gvisor/pkg/hostarch": "will crash on non-4K page sizes; see https://github.com/tailscale/tailscale/issues/8658",
},
}.Check(t)
}