| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
This commit replaces all `ioutil.TempDir` with `t.TempDir` in tests.
The directory created by `t.TempDir` is automatically removed when the
test and all its subtests complete.
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
|
| |
|
|
|
|
| |
We've got a timeout of "bazel aquery". It's currently set to 1 minute.
On an overloaded machine it can fire falsely, I guess bazel can start
only for 1 minute. Increase to 10 minutes.
|
| |
|
|
|
|
|
|
|
|
| |
Mmapping plain files as shared memory leads to extra burden on the
system being fuzzed, because the OS will periodically sync that data to
the disk.
On Linux, use memfd_create to obtain a file handle for the shared memory
region. Experiments have demonstrated than it leads to 5-10% increase in
the fuzzing performance.
|
| |
|
|
|
|
|
|
|
|
|
| |
Currently Abs captures pwd in init function and checks
that it's not changing over program execution.
However, in some test environments (bazel) we need to chdir
in test init function because the test process is started
in a wrong dir. This causes the check in Abs to fail.
Query the pwd lazily on the first Abs call.
This does not change behavior for Abs users, but allows
to change pwd in other init functions.
|
| |
|
|
|
| |
Doing so can result in syz-manager leaking GCE instances. Set PDEATHSIG
to SIGTERM instead, so that syz-manager has a change to exit gracefully.
|
| |
|
|
|
|
|
|
|
|
|
| |
"make generate" produces this diff when go 1.17 (go1.17-c95464f0ea3f==upstream)
is used. Seems compatible with >=1.16.
https://github.com/golang/go/commit/4d2d89ff42ca documents the syntax.
https://github.com/golang/go/commit/eeadce2d8713 enforces "ignore" for
unsatisfiable tags hence the pkg/csource/gen.go change.
Signed-off-by: Alexey Kardashevskiy <aik@linux.ibm.com>
|
| |
|
|
| |
Knowning the new wd may help to localize the error.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
1. Copy seeds from syzkaller checkout into syzkaller build dir.
They need to be stable.
2. Make the code generic (current is linux-specific).
3. Don't copy seeds to workdir/seeds.
We can load them directly from sys/OS/test.
There are some unresolved comments for LinkDir on #2053 anyway.
Follow up to #2053
|
| |
|
|
| |
Follow up to #2053
|
| |
|
|
|
|
|
| |
This commit enables the syz-manager to add unit test files as corpus to
accelerate fuzzing. The syz-ci would copy unit tests into the
worker/seeds folder for each manager process, and the manager would add
those tests as seed into the corpus.
|
| |
|
|
|
|
|
| |
Turns out ast.Inspect does not visit most comments.
Walk file.Comments manually.
Update #1876
|
| |
|
|
|
| |
Appengine doesn't provide appengine tag anymore.
Resort to use of syscall package for ExitStatus instead.
|
| |
|
|
| |
It's not present in Go 1.11.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Use unix.Unmount instead of manually wrapping SYS_UMOUNT2.
Use unix.IoctlSetPointerInt instead of manually wrapping SYS_IOCTL. This
also allows to use FS_IOC_SETFLAGS instead of manually defining it for
each GOARCH.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
|
|
| |
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* mmap syscall is special on Linux s390x because
the parameters for this syscall are passed as a struct
on user stack instead of registers.
* Introduce the SyscallTrampolines table into targets.Target
to address the above problem.
* There is a bug in Linux kernel s390x which causes QEMU TCG
to hang when KASAN is enabled. The bug has been fixed
in the forthcoming Linux 5.8 version. Until then do not enable
KASAN when using QEMU TCG, QEMU KVM shall have no problems with
KASAN.
Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
|
| |
|
|
| |
Prevents functions with too many nested if's.
|
| |
|
|
|
|
| |
CI does not have syzkaller user, but may run under root.
Update #1699
|
| |
|
|
|
|
|
|
|
| |
Add basic stuff to enable MIPS64ELR2 target:
- build
- make extract
- make generate
- qemu execution
- system call parsing from /proc/kallsyms
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new manager config argument workdir_template refers to a directory. Optional.
Each VM will get a recursive copy of the files that are present in workdir_template.
VM config can then use these private copies as needed. The copy directory
can be referenced with "{{TEMPLATE}}" string. This is different from using
the files directly in that each instance will get own clean, private,
scratch copy of the files. Currently supported only for qemu_args argument
of qemu VM type. Use example:
Create a template dir with necessary files:
$ mkdir /mytemplatedir
$ truncate -s 64K /mytemplatedir/fd
Then specify the dir in the manager config:
"workdir_template": "/mytemplatedir"
Then use these files in VM config:
"qemu_args": "-fda {{TEMPLATE}}/fd"
|
| |
|
|
| |
pkg/osutil/osutil_linux.go:44:13: cannot use info.Totalram (type uint32) as type uint64 in return argument
|
| |
|
|
|
|
|
| |
Ensure that we have at least 1GB per Makefile job.
Go compiler/linker can consume significant amount of memory
(observed to consume at least 600MB). See #1276 for context.
Update #1276
|
| |
|
|
|
|
|
|
|
|
| |
In some cases we start scp, which starts ssh,
then kill scp but the ssh subprocess is not killed.
As the result cmd.Wait hangs waiting for EOF on the stdout/stderr,
which are still kept alive by ssh subprocess. But ssh just hangs forever.
Create a process group for each command and kill whole process group.
Hopefully this will help.
|
| |
|
|
|
|
|
|
|
| |
Turns out git bisect fails to communicate some outcomes (multiple potential commits),
and the only way to understand what happened is parsing plain English output.
Extracting the output from the error is quite unhandy.
So return it with the error.
Update #501
|
| |
|
|
|
|
| |
If sandboxing is disabled don't unshare net namespace too.
Update #501
|
| |
|
|
|
|
|
|
|
| |
Just appending the pid number can produce conflicting names
if the name itself ends with digits (standard temp file naming convention).
So append ".PID".
Also remove beginning from too long names instead of ending.
Temp files in tests has unique numbers at the end, we need to preserve them
to avoid file name conflicts.
|
| | |
|
| |
|
|
|
| |
os.Rename fails for cross-device renaming (e.g. to/from tmpfs).
This is quite unpleasant. Provide own version that falls back to copying.
|
| |
|
|
|
|
|
| |
Add simple fuchsia program, the one that is run during image testing.
Fix csource errno printing for fuchsia.
Fix creation of executable files (chmod is not implemented on fuchsia).
Check that we get signal/coverage from all syscalls.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
all: add openbsd support
squash of the following commits:
* openbsd: add mandatory bits
* report: add OpenBSD support
* executor: skip building kvm on OpenBSD
* executor: add OpenBSD support
Linking against libutil is necessary due to usage of openpty(3).
* executor: fix typo in fail() message
* fixup! report: add OpenBSD support
* fixup! openbsd: add mandatory bits
* fixup! openbsd: add mandatory bits
* fixup! openbsd: add mandatory bits
* fixup! report: add OpenBSD support
* gometalinter: skip sys/openbsd
|
| |
|
|
|
|
|
|
| |
In pkg/ipc we don't just want to UmountAll,
we want to remove all handling as many cases as possible
(mounts, read-only files, etc, similar to executor's remove_dir).
So unmounting and removing needs to be a single function,
so that it can handle all these cases.
|
| |
|
|
|
|
| |
They were needed for intermediate gvisor support.
Now that we have end-to-end support for gvisor,
they are not needed anymore. Remove.
|
| |
|
|
|
|
| |
1. Make it clear when a command times out.
2. Don't add trailing newline for VerboseError if output is empty.
3. Fix WriteExecFile for the case when the file already exists.
|
| |
|
|
|
|
|
| |
See issue #640 where /dev/net/tun is present, but open fails with ENODEV.
Check that we can actually open all these files.
Fixes #640
|
| |
|
|
| |
Useful if caller wants to collect only stdout or stderr.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Currently kernel build failures are insanely verbose
(contain full kernel build output) and there is no
way to separate short descriptions from full output.
Make it possible.
Also try to extract failure root cause froom build log.
Use this in pkg/bisect to not pollute log on build failures.
Update #501
|
| |
|
|
|
|
|
|
| |
If SYZ_DISABLE_SANDBOXING=yes is set, don't do user sandboxing.
Will be usefule for bisection tool which runs locally,
but needs to build kernel.
Update #501
|
| |
|
|
| |
Introduce TempFile helper and use it in several packages.
|
| |
|
|
| |
Fix typos, non-canonical code, remove dead code, etc.
|
| | |
|
| |
|
|
| |
syzkallerNNN binaries are coming from pkg/repro.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
When manager is stopped there are sometimes runaway qemu
processes still running. Set PDEATHSIG for all subprocesses.
We never need child processes outliving parents.
|
| |
|
|
|
| |
This just makes make TARGETOS=netbsd succeed.
We don't yet have prog target for netbsd.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We currently use more complex and functional protocol on linux,
and a simple ad-hoc protocol on other OSes.
This leads to code duplication in both ipc and executor.
Linux supports coverage, shared memory communication and fork server,
which would also be useful for most other OSes.
Unify communication protocol and parametrize it by
(1) use of shmem or only pipes, (2) use of fork server.
This reduces duplication in ipc and executor and will
allow to support the useful features for other OSes easily.
Finally, this fixes akaros support as it currently uses
syz-stress running on host (linux) and executor running on akaros.
|