diff options
| -rw-r--r-- | vm/starnix/starnix.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vm/starnix/starnix.go b/vm/starnix/starnix.go index f5da7faf6..321dad489 100644 --- a/vm/starnix/starnix.go +++ b/vm/starnix/starnix.go @@ -142,6 +142,10 @@ func (inst *instance) boot() error { return fmt.Errorf("could not start and connect to the adb server: %w", err) } + if err := inst.restartAdbAsRoot(); err != nil { + return fmt.Errorf("could not restart adb with root access: %w", err) + } + if err := inst.createAdbScript(); err != nil { return fmt.Errorf("could not create adb script: %w", err) } @@ -243,6 +247,16 @@ func (inst *instance) connectToAdb(timeout time.Duration) error { } } +func (inst *instance) restartAdbAsRoot() error { + err := inst.runCommand( + "adb", + "-s", + fmt.Sprintf("127.0.0.1:%d", inst.port), + "root", + ) + return err +} + // Script for telling syz-fuzzer how to connect to syz-executor. func (inst *instance) createAdbScript() error { adbScript := fmt.Sprintf( |
