Skip to content

Commit 7bc5fea

Browse files
author
Sebastian Ene
committed
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>
1 parent a9fc522 commit 7bc5fea

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

vm/adb/adb.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"bytes"
1010
"context"
1111
"encoding/json"
12+
"errors"
1213
"fmt"
1314
"io"
1415
"os"
@@ -390,8 +391,16 @@ func (inst *instance) repair() error {
390391
// reliable solution can be sought out.
391392
if inst.cfg.TargetReboot {
392393
if _, err := inst.adb("shell", "reboot"); err != nil {
393-
return err
394+
var verboseErr *osutil.VerboseError
395+
if !errors.As(err, &verboseErr) {
396+
return err
397+
}
398+
399+
if verboseErr.ExitCode != 0 && verboseErr.ExitCode != 255 {
400+
return err
401+
}
394402
}
403+
395404
// Now give it another 5 minutes to boot.
396405
if !vmimpl.SleepInterruptible(10 * time.Second) {
397406
return fmt.Errorf("shutdown in progress")

0 commit comments

Comments
 (0)