diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-05-10 12:59:03 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-05-10 12:59:03 -0700 |
commit | 6c349c675c49f1059efbcadb6b04123ab2357ca2 (patch) | |
tree | 3b879ea073eb24a0688f6a2063e7c492cbbb0294 /runsc/cmd | |
parent | e691004e0c6c1ceb8626d5369c8bd76dbf67f87e (diff) | |
parent | 73679fae2a74697f26aedf9c5d219368bd4de469 (diff) |
Merge pull request #5764 from zhlhahaha:2126-2
PiperOrigin-RevId: 372993341
Diffstat (limited to 'runsc/cmd')
-rw-r--r-- | runsc/cmd/mitigate.go | 6 | ||||
-rw-r--r-- | runsc/cmd/mitigate_test.go | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/runsc/cmd/mitigate.go b/runsc/cmd/mitigate.go index d37ab80ba..f4e65adb8 100644 --- a/runsc/cmd/mitigate.go +++ b/runsc/cmd/mitigate.go @@ -18,6 +18,7 @@ import ( "context" "fmt" "io/ioutil" + "runtime" "github.com/google/subcommands" "gvisor.dev/gvisor/pkg/log" @@ -72,6 +73,11 @@ func (m *Mitigate) SetFlags(f *flag.FlagSet) { // Execute implements subcommands.Command.Execute. func (m *Mitigate) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) subcommands.ExitStatus { + if runtime.GOARCH == "arm64" || runtime.GOARCH == "arm" { + log.Warningf("As ARM is not affected by MDS, mitigate does not support") + return subcommands.ExitFailure + } + if f.NArg() != 0 { f.Usage() return subcommands.ExitUsageError diff --git a/runsc/cmd/mitigate_test.go b/runsc/cmd/mitigate_test.go index 5a76667e3..2d3fef7c1 100644 --- a/runsc/cmd/mitigate_test.go +++ b/runsc/cmd/mitigate_test.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// +build amd64 + package cmd import ( |