diff options
| author | Sebastian Ene <sebastianene@google.com> | 2026-01-14 13:56:59 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2026-01-20 08:32:46 +0000 |
| commit | faf99a10ff35487a689ef7a183b1081da5369152 (patch) | |
| tree | ee4c21d02bc04902792870e7fd8f3d7780550926 | |
| parent | 572effc1e38bd5189752c98d08f439f1043d825c (diff) | |
vm/adb: don't check for ret code on adb shell reboot
Prevent the fuzzer from entering in an infinte loop
of device reboots when the adb shell reboot command
returns with an error code.
Fixes: #6598
Signed-off-by: Sebastian Ene <sebastianene@google.com>
| -rw-r--r-- | vm/adb/adb.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vm/adb/adb.go b/vm/adb/adb.go index 79c4ebe12..d8d78e833 100644 --- a/vm/adb/adb.go +++ b/vm/adb/adb.go @@ -9,6 +9,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" "os" @@ -390,8 +391,16 @@ func (inst *instance) repair() error { // reliable solution can be sought out. if inst.cfg.TargetReboot { if _, err := inst.adb("shell", "reboot"); err != nil { - return err + var verboseErr *osutil.VerboseError + if !errors.As(err, &verboseErr) { + return err + } + + if verboseErr.ExitCode != 0 && verboseErr.ExitCode != 255 { + return err + } } + // Now give it another 5 minutes to boot. if !vmimpl.SleepInterruptible(10 * time.Second) { return fmt.Errorf("shutdown in progress") |
