| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Any is the preferred over interface{} now in Go.
|
| |
|
|
|
| |
Break checkCallResult() down into smaller functions, checkCallStatus() and
checkCallCoverage().
|
| |
|
|
| |
Implement a pseudo-syscall to check the value of kvm_run.exit_reason
|
| |
|
|
|
|
|
|
|
|
| |
Pseudo-syscalls from noCovSyscalls may not generate any coverage, which
leads to a crash in the following line:
if len(inf.Signal) < 2 && !calls[callName] && len(info.Extra.Signal)
Make sure that this check is only done for calls not belonging to
noCovSyscalls.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new vminfo feature, FeatureKcovResetIoctl, that is true if the
kernel supports ioctl(KCOV_RESET_TRACE) making it possible to reset the
coverage buffer on the kernel side. This, in turn, allows us to map the
coverage buffer read-only, which will prevent all sorts of
userspace-generated corruptions at a cost of an extra syscall per program
execution.
The corresponding exec env flag, ExecEnv::ReadOnlyCoverage, turns on
read-only coverage in the executor. It is enabled by default
if FeatureKcovResetIoctl is on.
|
| |
|
|
| |
./tools/syz-env bin/golangci-lint run ./... --fix
|
| |
|
|
| |
This will help us eventually debug #6109.
|
| | |
|
| |
|
|
|
| |
Accept context as a function argument.
Split out the code that creates a syz-executor process instance.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of generating Go files with descriptions
serialize them as gob and compress with flate.
This significantly reduces build time, go vet time,
and solves scalability problems with some static analysis tools.
Reference times (all after rm -rf ~/.cache/go-build) before:
TIME="%e %P %M" time go install ./syz-manager
48.29 577% 4824820
TIME="%e %P %M" time go test -c ./prog
56.28 380% 6973292
After:
TIME="%e %P %M" time go install ./syz-manager
22.81 865% 859788
TIME="%e %P %M" time go test -c ./prog
12.74 565% 267760
syz-manager size before/after: 194712597 -> 83418407
-57% even provided we now embed all descriptions
instead of just a single arch.
Deflate/decoding time for a single Linux arch is ~330ms.
Fixes #5542
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We query globs for 2 reasons:
1. Expand glob types in syscall descriptions.
2. Dynamic file probing for automatic descriptions generation.
In both of these contexts are are interested in files
that will be present during test program execution
(rather than normal unsandboxed execution).
For example, some files may not be accessible to test programs
after pivot root. On the other hand, we create and link
some additional files for the test program that don't
normally exist.
Add a new request type for querying of globs that are
executed in the test program context.
|
| |
|
|
|
| |
The new pseudo-syscall will serve as a test assertion, checking the uexit
return value. This is going to help us validate SyzOS code.
|
| |
|
|
|
|
|
|
|
| |
When running the executor tests, do not rely on qemu-user providing
binfmt_misc handlers for alien arches (e.g. arm64 on x86), because
binfmt_misc cannot be mounted inside the Docker container.
Instead, explicitly run the cross-compiled executor under the
corresponding QEMU binary.
|
| |
|
|
|
| |
When running on Github CI, turn every failure to start a cross-arch binary
(e.g. due to missing qemu-user) into a fatal error.
|
| |
|
|
|
|
|
| |
Previously, cross-platform invocations of `syz-executor test` were ignored
in the case of a SYZFAIL, and the test was still marked as PASS.
Explicitly report a test failure instead.
|
| |
|
|
|
|
|
|
|
|
| |
When running in the test mode, syz-manager already ignores tests that have
arch requirements mismatching the target arch.
Because the same tests are also used as seeds in the fuzzing mode, skip them
likewise, instead of reporting errors if they contain arch-specific syscalls.
The code and tests for parsing the requirements is moved from pkg/runtest to
pkg/manager.
|
| | |
|
| |
|
|
|
|
|
| |
Currently we write coverage backwards.
This is visible e.g. when running syz-execprog -coverfile,
and in the manager raw cover mode.
Write it in the right order.
|
| |
|
|
| |
It will help us catch broken seeds right in TestParse().
|
| | |
|
| |
|
|
| |
Without that, tests that e.g. require arch=arm64 fail on an ARM64 VM.
|
| |
|
|
|
| |
Instead of bailing out on the first program with e.g. parsing errors,
create a "failing" runRequest for each of such programs.
|
| | |
|
| |
|
|
|
|
| |
Run method usually runs in a separate goroutine concurrently with request consumer
(Next calls), so at least executor needs to be initialized before Run.
Otherwise we can get episodic nil derefs in Next method.
|
| | |
|
| |
|
|
|
|
|
|
| |
We never reset remote coverage, so if there is one block,
we will write it after every call and multiple times at the end.
It can lead to "too many calls in output" and just writes quadratic
amount of coverage/signal.
Reset remote coverage after writing.
|
| |
|
|
|
|
|
|
|
| |
We are getting too many generated candidates, the fuzzer may not keep up
with them at all (hints jobs keep growing infinitely). If a hint indeed came
from the input w/o transformation, then we should guess it on the first
attempt (or at least after few attempts). If it did not come from the input,
or came with a non-trivial transformation, then any number of attempts won't
help. So limit the total number of attempts (until the next restart).
|
| |
|
|
|
| |
Fixes: a6f99ace4014 ("pkg/rpcserver: move kernel test/data range checks from executor")
Signed-off-by: Alexander Egorenkov <eaibmz@gmail.com>
|
| |
|
|
|
| |
On 32 core machines, we spin up 32 executor procs per each subtest.
In many cases, we don't need that many.
|
| |
|
|
|
|
|
|
| |
In some cases, the executor seems to be mysteriously silent when we were
awaiting a reply.
During pkg/runtest tests, give it 1 minute to prepare a reply, then try
to request the current state and abort the connection.
|
| |
|
|
|
| |
The cancellable context will let us abort runtest early in case of
problems.
|
| |
|
|
|
| |
Otherwise there's a risk of an infinite hang in case RPCServer has
finished its execution.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
I still see the following errors in every other run:
=== CONT TestCover/64/1
=== NAME TestCover/64/3
testing.go:1232: TempDir RemoveAll cleanup: unlinkat /tmp/TestCover6431888025363/001: directory not empty
=== CONT TestCover/64_fork/0
=== CONT TestCover/64_fork/9
=== NAME TestCover/64/1
testing.go:1232: TempDir RemoveAll cleanup: unlinkat /tmp/TestCover6412810450597/001: directory not empty
We set PR_SET_PDEATHSIG for subprocesses, but we still don't wait for them to terminate.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We see some errors of the form:
SYZFAIL: coverage filter is full
pc=0x80007000c0008 regions=[0xffffffffbfffffff 0x243fffffff 0x143fffffff 0xc3fffffff] alloc=156
Executor shouldn't send non kernel addresses in signal,
but somehow it does. It can happen if the VM memory is corrupted,
or if the test program does something very nasty (e.g. discovers
the output region and writes to it).
It's not possible to reliably filter signal in the tested VM.
Move all of the filtering logic to the host.
Fixes #4942
|
| | |
|
| |
|
|
| |
This allows to enable test executor with coverage.
|
| |
|
|
| |
This reverts commit 62e12a69a0ef8fec1cc0648b1314428621f9a697.
|
| |
|
|
|
|
|
|
|
| |
We need this in pkg/runtest since not all TestOS targets natively
support the coverage instrumentation.
We used to achieve this by starting the RPC server with Coverage=false
and then updating it to Coverage=true to suppress fallback the fallback
signal, but it's better to avoid such runtime config changes.
|
| |
|
|
|
| |
Fail some features in various ways for test OS,
and check that features are detected properly.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parsing auto-generated seeds takes lots of time:
--- PASS: TestParsing/linux/mips64le (56.86s)
--- PASS: TestParsing/linux/amd64 (53.63s)
--- PASS: TestParsing/linux/arm64 (53.32s)
--- PASS: TestParsing/linux/arm (53.57s)
--- PASS: TestParsing/linux/386 (53.59s)
--- PASS: TestParsing/linux/s390x (43.09s)
--- PASS: TestParsing/linux/riscv64 (43.17s)
--- PASS: TestParsing/linux/ppc64le (43.12s)
Don't even parse them. After:
--- PASS: TestParsing/fuchsia/amd64 (0.48s)
--- PASS: TestParsing/test/64_fork (0.59s)
--- PASS: TestParsing/linux/386 (3.04s)
--- PASS: TestParsing/linux/arm64 (3.08s)
--- PASS: TestParsing/linux/riscv64 (3.10s)
--- PASS: TestParsing/linux/s390x (3.13s)
--- PASS: TestParsing/linux/amd64 (3.13s)
--- PASS: TestParsing/linux/arm (3.14s)
--- PASS: TestParsing/linux/mips64le (3.21s)
--- PASS: TestParsing/test/32 (0.37s)
--- PASS: TestParsing/fuchsia/arm64 (0.35s)
--- PASS: TestParsing/test/32_fork (0.57s)
--- PASS: TestParsing/test/64 (0.53s)
--- PASS: TestParsing/test/64_fuzz (0.54s)
--- PASS: TestParsing/linux/ppc64le (2.87s)
|
| |
|
|
|
|
|
| |
Move all syz-fuzzer logic into syz-executor and remove syz-fuzzer.
Also restore syz-runtest functionality in the manager.
Update #4917 (sets most signal handlers to SIG_IGN)
|
| |
|
|
| |
Signed-off-by: Alexander Egorenkov <eaibmz@gmail.com>
|
| |
|
|
|
|
|
| |
Use the intended Request.OnDone() mechanism to implement the retry
logic.
Fixes #4843.
|
| |
|
|
|
|
|
| |
We incorrectly extended comparison arguments since forever. This is sad.
We tested the prog logic, but not the ipc/executor part.
Fix the extension, add tests and force manager to re-triage inputs.
|
| |
|
|
|
|
| |
We ignore comparisons of kernel data/physical addresses b/c these
are not coming from user space. Ignore kernel text addresses
for the same reason.
|
| |
|
|
| |
Factor out is_kernel_pc helper and add kernel pc range for test OS for testing.
|
| | |
|
| |
|
|
|
|
| |
Litte-endian is kind of default (except for s390).
So instead of saying that each arch is litte-endian,
mark only s390 as big-endian.
|
| |
|
|
|
|
|
|
|
| |
All OSes we have now support shmem.
Support for Fuchia/Starnix/Windows wasn't implemented,
but generally they support shared memory.
Remove all of the complexity and code associated with noshmem mode.
If/when we revive these OSes, it's easier to properly
implement shmem mode for them.
|