aboutsummaryrefslogtreecommitdiffstats
path: root/vm/vmimpl/util.go
Commit message (Collapse)AuthorAgeFilesLines
* vm: use error wrapping to detect ssh connection errorsAleksandr Nogikh2025-10-011-1/+3
| | | | This is a much cleaner logic than string matching.
* pkg/osutil: make VerboseError nest other errorsAleksandr Nogikh2025-10-011-1/+4
| | | | | After this change it fits more naturally into the Go's error functionality.
* vm: use SSHOptions instead of 4 paramsTaras Madan2025-03-271-3/+9
| | | | It reduces WaitForSSH parameter count from 9 to 6.
* vm/isolated: allow the use of system-wide SSH configFlorent Revest2024-03-191-15/+19
| | | | | | | | | | | | Most of the VM types tightly manage the target they SSH into and can safely assume that system wide SSH configuration would mess with the SSH flags provided by syzkaller. However, in the "isolate" VM type, one can connect to a host that is not at all managed by syzkaller. In this case, it can be useful to leverage system wide SSH config, maybe provided by a corporate environment. This adds an option to the isolated config to skip some of the SSH and SCP flags that would drop system wide config.
* vm/qemu: restrict network accessDmitry Vyukov2021-02-081-3/+11
| | | | | | | Restrict access to the external network from within the VM and access to VM SSH to local interface only. Fixes #332
* sys/targets: add OS/Arch name constsDmitry Vyukov2020-10-261-1/+2
| | | | | | | | | | | | We use strings to identify OS/Arch. These strings are duplicated throughout the code base massively. golangci-lint points to possiblity of typos and duplication. We already had to define these names in pkg/csource and disable checking for prog package. A future change triggers such warnings in another package. Add OS/Arch name consts to sys/targets so that they can be used to refer to OS/Arch. Use the consts everywhere.
* Revert "vm/vmimpl: disallow ssh authentication agent"Dmitry Vyukov2020-08-181-1/+0
| | | | | | | | | | This reverts commit b9683dbdfdbea5815c2cf48b20aada181dca1be3. Majority of syzbot instances started failing with: failed to run ["ssh" "-p" "22" "-F" "/dev/null" "-o" "UserKnownHostsFile=/dev/null" "-o" "BatchMode=yes" "-o" "IdentitiesOnly=yes" "-o" "IdentityAgent=none" "-o" "StrictHostKeyChecking=no" "-o" "ConnectTimeout=10" "-i" "/syzkaller/managers/upstream-bpf-next-kasan-gce/latest.tmp/key" "root@10.128.15.195" "pwd"]: exit status 255 command-line: line 0: Bad configuration option: identityagent command-line: line 0: Bad configuration option: identityagent
* vm/vmimpl: disallow ssh authentication agentMarco Vanotti2020-08-181-0/+1
| | | | | | | This commit adds a new option to SSH options, disallowing the authentication agent. This is specially useful when you are testing in a machine that sets the `SSH_AUTH_SOCK` environment variable, as ssh will try to use that authentication agent on each ssh connection.
* vm/qemu: detect boot errors fasterDmitry Vyukov2019-03-171-2/+6
| | | | | | | | | Currently we try to ssh into the machine for 10 minutes even if it crashed right away. Make qemu exit on kernel panic and stop ssh'ing when qemu exits. Handling bad kernels fast is actually important for bisection. Update #501
* vm/vmimpl: don't pass ssh key twiceDmitry Vyukov2019-02-221-1/+3
|
* vm/vmimpl: fix vet warning about unkeyed structDmitry Vyukov2019-01-251-1/+1
|
* vm/vmimpl: produce better error in WaitForSSHDmitry Vyukov2019-01-241-1/+1
| | | | | Currently we squash VerboseError which leads to too lengthy build error titles. Handle verbose error more carefully.
* vm/vmimpl: factor out common code for ssh args and waiting for sshDmitry Vyukov2018-07-061-0/+57
| | | | Move common code from 4 vm implementations to vmimpl.
* vm: overhaulDmitry Vyukov2017-06-031-0/+19
VM infrastructure currently has several problems: - Config struct is complete mess with a superset of params for all VM types - verification of Config is mess spread across several places - there is no place where VM code could do global initialization like creating GCE connection, uploading GCE image to GCS, matching adb devices with consoles, etc - it hard to add private VM implementations such impl would need to add code to config package which would lead to constant merge conflicts - interface for VM implementation is mixed with interface for VM users this does not allow to provide best interface for both of them - there is no way to add common code for all VM implementations This change solves these problems by: - splitting VM interface for users (vm package) and VM interface for VM implementations (vmimpl pacakge), this in turn allows to add common code - adding Pool concept that allows to do global initialization and config checking at the right time - decoupling manager config from VM-specific config each VM type now defines own config Note: manager configs need to be changed after this change: VM-specific parts are moved to own "vm" subobject. Note: this change also drops "local" VM type. Its story was long unclear and there is now syz-stress which solves the same problem.