Commit Graph

5492 Commits

Author SHA1 Message Date
Dmitry Vyukov
bee38a2be5 dashboard/config: enable more filesystems
+CONFIG_NILFS2_FS=y
+CONFIG_ORANGEFS_FS=y
+CONFIG_ADFS_FS=y
+CONFIG_AFFS_FS=y
+CONFIG_BEFS_FS=y
+CONFIG_EFS_FS=y
+CONFIG_JFFS2_FS=y
+CONFIG_CRAMFS=y
+CONFIG_VXFS_FS=y
+CONFIG_OMFS_FS=y
+CONFIG_HPFS_FS=y
+CONFIG_QNX4FS_FS=y
+CONFIG_QNX6FS_FS=y
+CONFIG_ROMFS_FS=y
+CONFIG_SYSV_FS=y
+CONFIG_UFS_FS=y
2020-09-20 15:12:12 +02:00
Dmitry Vyukov
8394d04bf6 sys/linux: add syz_mount_image for 20 more file systems 2020-09-20 15:12:12 +02:00
Dmitry Vyukov
a5e37d4a8e pkg/runtest: split parsing tests into OS/arch subtests 2020-09-20 15:12:12 +02:00
Dmitry Vyukov
7b84681e92 pkg/csource: don't test auto-generated files
syz_mount_image tests are very large and TestSysTests takes too long.
syz-imagegen that generates them does some of this testing
(Deserialize/SerializeForExec).
2020-09-20 15:12:12 +02:00
Dmitry Vyukov
5620c9c4db prog: allow arbitrary long lines in serialized programs
We use bufio.Scanner and it has mandatory limit on line length.
The file system tests (sys/linux/test/syz_mount_image_*) has
very long lines (megabytes).
Remove the restriction on line length.
2020-09-20 15:12:12 +02:00
Dmitry Vyukov
43f95803e9 prog: extend error message on deserialization error 2020-09-20 15:12:12 +02:00
Dmitry Vyukov
9371418543 tools/syz-imagegen: add few more f2fs features
Add flexible_inline_xattr, inode_checksum, inode_crtime, project_quota features.
2020-09-20 15:12:12 +02:00
Dmitry Vyukov
4dc0927070 syz-manager: fix logical races in rpc request handling
It is possible that we already called shutdownInstance,
but have some requests from this instance already in-flight.
Handle this case gracefully.
2020-09-20 15:12:12 +02:00
Dmitry Vyukov
1c1eb4919d tools/syz-imagegen: generate full test files instead of bash scripts
tools/create_{f2fs,btrfs}_image.sh are... well, shell scripts.
It's hard to scale this appraoch to more file systems
avoiding duplication and stupid errors while doing proper
error handling and parallelization.
Upgrade syz-imagegen to generate full test files and replace
the shell scripts.

f2fs -O=compression options is removed, it does not seem to be
supported by mkfs.f2fs, it always says:
Error: Wrong features
The shell script used it, but it seems that the way it passed
arguments (in a single '-quoted string) just made mkfs misparse
the arguments (use only the first one?) and so -O=compression
and most other arguments were simply ignored.
2020-09-20 15:12:12 +02:00
Tetsuo Handa
53ce8104a7 Makefile: try to install g++ package explicitly
Since executor/gen.go invokes "gcc kvm_gen.cc kvm.S -o kvm_gen", g++ is needed.

  go generate ./pkg/csource ./executor ./pkg/ifuzz ./pkg/build ./pkg/html
  gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
  compilation terminated.
  executor/gen.go:6: running "bash": exit status 1
2020-09-18 14:01:27 +02:00
Alexander Egorenkov
49ad2baf8c executor: forbid inlining of 'remove_dir'
Fixes the issue with gcc 10 on Fedora 32 s390x:

In file included from ../../executor/executor.cc:147:
../../executor/common.h: In function ‘void remove_dir(const char*)’:
../../executor/common.h:229:44: error: ‘%s’ directive output may be
truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
229 | snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name);
| ^~
../../executor/common.h:229:11: note: ‘snprintf’ output between 2 and 4352 bytes into a destination of size 4096
229 | snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name);

../../executor/common.h:243:1: error: the frame size of 21200 bytes is larger than 16384 bytes
[-Werror=frame-larger-than=]
243 | }
| ^
cc1plus: all warnings being treated as errors

compiler invocation: gcc [-o /tmp/syz-executor383272105 -DGOOS_test=1 -DGOARCH_64_fork=1 -DHOSTGOOS_linux=1
../../executor/executor.cc -m64 -no-pie -O2 -pthread -Wall -Werror -Wparentheses
-Wunused-const-variable -Wframe-larger-than=16384]
FAIL
FAIL github.com/google/syzkaller/pkg/runtest 0.998s
FAIL

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-09-18 09:58:50 +02:00
Andrew Donnellan
38962c8b05 tools/create-image.sh: map qemu -> Debian architecture names
create-image.sh assumes that the qemu name and the Debian name for the
target architecture are the same. This is not always true.

For comedy and/or historical reasons, Debian refers to 64-bit little
endian PowerPC as ppc64el, whereas qemu and most other things use ppc64le.
Debian refers to aarch64 as arm64, and 32-bit little endian arm as armel.
Add special cases to handle this.

Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
2020-09-18 07:52:38 +02:00
Alexander Egorenkov
8c70a2f7b7 sys/targets: use -m31 gcc option on s390x arch for 32bit targets
In ESA/S390 mode, the CPU is able to address only 31bit of
memory address space. GCC on s390x expects the flag -m31 instead
of -m32 for 32bit code.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-09-18 07:49:33 +02:00
Alexander Egorenkov
8247808b71 pkg/host: use 'processor 0' as cpu model on s390x inside container
There is no field 'machine' in /proc/cpuinfo when we run inside
a Docker container but there is a 'processor 0' field which
provides the same information.

Example:

processor 0: version = 00,  identification = 310C57,  machine = 3906

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-09-16 21:15:40 +02:00
Dmitry Vyukov
5a3d0ca04d dashboard/config: enable UBSAN in KASAN config
Enable CONFIG_UBSAN/CONFIG_UBSAN_BOUNDS.
Regenerate config on linux-next 20200916.

Update #1523
2020-09-16 15:22:52 +02:00
Dmitry Vyukov
da5350eb9a pkg/report: support new linux UBSAN format
Update #1523
2020-09-16 15:22:52 +02:00
Dmitry Vyukov
77507d0229
docs: add another research paper 2020-09-16 13:39:40 +02:00
Dmitry Vyukov
5505e2dcdd prog: add missing \n in printf 2020-09-16 13:33:06 +02:00
Dmitry Vyukov
18d7d030e5 vm/vmimpl: update console code for the new unix package
The current code is now broken on darwin:

syzkaller$ GOOS=darwin go install ./vm/...
vm/vmimpl/console.go:30:33: undefined: unix.SYS_IOCTL
vm/vmimpl/console.go:45:32: undefined: unix.SYS_IOCTL
2020-09-15 19:34:30 +02:00
Dmitry Vyukov
a2267789b8 .github: reorder CODEOWNERS owner entries
I mis-interpreted the order of entries:
"Order is important; the last matching pattern takes the most precedence."
https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax

The idea is to not pull in all OS maintainers for vendor/ updates.
2020-09-15 19:34:30 +02:00
Dmitry Vyukov
c478111a98 pkg/build, pkg/html: move generation logic into separate scripts
Mentions of "// Code generated ... DO NOT EDIT." in these Go files
somehow prevents golangci-lint from checking them.
And github treats them as auto-generated as well.
I guess some code somewhere has some imprecise heuristics.
Move generation into separate shell scripts. Also cleaner.
2020-09-15 19:34:30 +02:00
Dmitry Vyukov
2d37b9667e sys/openbsd: fix linter warnings
sys/openbsd/init.go:58:36: Top level comment should end in a period
	// kCoverFd in executor/executor.cc
	                                  ^
sys/openbsd/init.go:60:38: Top level comment should end in a period
	// kOutPipeFd in executor/executor.cc
	                                    ^
2020-09-15 19:34:30 +02:00
Dmitry Vyukov
712de1c63d vendor/github.com/golangci/golangci-lint: update to v1.31 2020-09-15 19:34:30 +02:00
Dmitry Vyukov
298a69c38d docs/linux: fix whitespaces in coverage doc 2020-09-15 15:50:24 +02:00
m5imunovic
0f06037d76 docs/linux/coverage.md: expand readelf section and reformat 2020-09-15 15:50:24 +02:00
m5imunovic
ffd13eb166 docs/linux/coverage.md: fix doc format 2020-09-15 15:50:24 +02:00
m5imunovic
a7abe2602c CONTRIBUTORS: add Marijo Simunovic 2020-09-15 15:50:24 +02:00
m5imunovic
ca3158ee9a docs/linux/coverage.md: expand coverage reporting doc 2020-09-15 15:50:24 +02:00
Alexander Egorenkov
3b5eb29afb pkg/host: use 'machine' field as cpu model on IBM/Z
Use the field 'machine' in /proc/cpuinfo on IBM/Z
to find out the "CPU model".

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-09-15 15:06:24 +02:00
Heyuan Shi
6989d6f61d docs: clarify coverage point in different compliers 2020-09-15 09:39:09 +02:00
Dmitry Vyukov
9e681632f5 pkg/osutil: fix LinkFiles/FilesExist for the new pattern format 2020-09-15 09:37:22 +02:00
Dmitry Vyukov
a2360d0742 executor: fix definition of __NR_io_uring_setup
Sone syzbot instances broke with:

<stdin>: In function ‘syz_io_uring_setup’:
<stdin>:476:33: error: ‘__NR_io_uring_setup’ undeclared (first use in this function)
<stdin>:476:33: note: each undeclared identifier is reported only once for each function it appears in

pkg/csource resolves #ifdef's at generation time.
2020-09-15 08:40:10 +02:00
Dmitry Vyukov
6c16e36a7b pkg/host: make machine info tests linux-specific
TestScanCPUInfo does not build on !linux.
TestMachineInfoLinux builds, but does not do anything useful.
2020-09-14 15:15:06 +02:00
Dmitry Vyukov
3e84253bf4 dashboard/app: fix up machine info handling
Assorted local fixes fixes, like dedup machine info in the database,
fix up HTML table markup, enforce and check access to the machine info
entities, etc.

Follow up to #2085
Fixes #466
2020-09-14 15:00:02 +02:00
Cheng-Min Chiang
9eff3337ee dashboard/app: send machine information to dashboard
- Change syz-manager so that it will send machine info the first time a
  crash occurs.
- Add a field in entities.Crash to store machine info.
- Add a field in dashapi.BugReport to store machine info.
- Change the HTML template and struct uiCrash to display machine info.
- Add a test to make sure that the link to machine info appears on the
  webpage.

Update #466
2020-09-14 15:00:02 +02:00
Alexander Egorenkov
df4f5a9c4a tools/create-gce-image.sh: support s390x
Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-09-14 13:09:25 +02:00
Dmitry Vyukov
dfb4c36914 tools/create_btrfs_image.sh: fix up and re-run
The previous commit did not get all intended changes.

Follow up to 2066
2020-09-14 11:08:16 +02:00
Dmitry Vyukov
fcf44ed305 tools/create_btrfs_image.sh: fix script
1. Use set -eu
2. Use consistent name of the generated files
3. Add "requires: manual"
4. Fix some option combinations that lead to errors

Follow up to 2066
2020-09-14 10:56:04 +02:00
Jiaheng Hu
bf0df4cba7 sys/linux: mount btrfs tests
Add several unit tests that mount different versions of btrfs images, and
the .sh file that generates these tests.
2020-09-14 10:56:04 +02:00
Dmitry Vyukov
dd93b2327c syz-manager: load test programs as candidates
1. Load test programs directly from sys/OS/test.
   Since we have sykaller dir, we don't need separate workdir/seeds.

2. Load test programs into candidates avoiding pulling them into corpus.
   This unbreaks mgr.fresh detection and does not pollute corpus with
   programs that don't give coverage/contain unsupported syscalls, etc.

Follow up to #2053
2020-09-14 10:38:36 +02:00
Dmitry Vyukov
605d25b511 syz-ci: fix seeds copying
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
2020-09-14 10:38:36 +02:00
Dmitry Vyukov
bf14d79b03 pkg/osutil: support glob patterns in CopyFiles
Follow up to #2053
2020-09-14 10:38:36 +02:00
Dmitry Vyukov
fab7609913 tools/check-whitespace.sh: check for trailing whitespaces
File types that we don't format automatically can end up
with such basic untidiness as trailing whitespaces.
Check for these. Remove all existing precedents.
2020-09-14 09:55:45 +02:00
Jiaheng Hu
3f1d02b23f syz-manager: add test file as corpus
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.
2020-09-14 09:52:09 +02:00
Seonghyun Park
75cbe1c0ce tools/create-image.sh: resolve mismatch between help message and opt parsing 2020-09-14 06:47:09 +02:00
Dmitry Vyukov
2d3cdd63ad tools/create_f2fs_image.sh: name tests after the syscall
Make things consistent.

Follow up to #2032
2020-09-13 19:28:47 +02:00
Dmitry Vyukov
55b6cd4333 pkg/runtest: test parsing of all tests
Currently we only test parsing in tools/syz-runtest
and for test OS in pkg/runtest tests.
This means errors in tests for other OSes won't be
noticed until somebody runs tests manually.
Test parsing of all tests in pkg/runtest tests.
Fix up 2 broken tests.
2020-09-13 19:28:47 +02:00
Dmitry Vyukov
c52d06e410 sys/linux/test: mark f2fs tests as manual
Introduce "manual" requirement for tests (only run if explicitly selected)
and mark f2fs tests as manual. There are too many of them.

Follow up to #2032
2020-09-13 19:28:47 +02:00
Jiaheng Hu
84b0c3d8f6 sys/linux: add mount f2fs test
Add several unit tests that mount different versions of  f2fs image, and
the .sh file that generates these tests.
2020-09-13 18:42:14 +02:00
Mark Johnston
8a9bdb4a7e sys/freebsd: add definitions for large pages
Also add SHM_GROW_ON_WRITE, missed previously.
2020-09-13 17:15:57 +02:00