Commit Graph

2995 Commits

Author SHA1 Message Date
Dmitry Vyukov
8978109043
Update found_bugs.md 2018-10-31 12:05:49 +01:00
Dmitry Vyukov
4ccf7bb438 sys/linux: limit init_module size argument
Kernel tries to vmalloc whatever we pass as size and it's not accounted against memcg.
As the result it can lead to massive OOM kills of everything running on the machine.
Strictly saying, the same applies to finit_module with a sparse file too,
but there is no simple way to handle that.
2018-10-30 17:42:18 +01:00
shankarapailoor
06a012d997 sys/linux: adding constants for trace2syz to sockets 2018-10-30 17:18:39 +01:00
shankarapailoor
72add0ff6f sys/linux: add perf, kvm, btrfs consts for trace2syz 2018-10-30 14:04:49 +01:00
Shankara Pailoor
8dbb755a2e sys/linux: add additional constants for trace2syz to bpf
Fixes #783
2018-10-30 11:31:42 +01:00
Dmitry Vyukov
12b38f22c1 sys/linux: fix up descriptions
1. Extract consts on the latest linux tree.
2. Don't manually define O_TMPFILE/O_ACCMODE/_LINUX_CAPABILITY_VERSION_N,
   they are defined in kernel headers.
3. Don't use CLOCK_SGI_CYCLE as clock id, it's not implemented.
2018-10-30 11:15:50 +01:00
shankarapailoor
362ef76397 sys/linux: add additional constants for trace2syz 2018-10-30 10:58:45 +01:00
Greg Steuck
2f1090dacd sys/openbsd: added minherit, extended/simplified mmap
* sys/openbsd: added minherit, extended/simplified mmap.

Added a script from anton_at_openbsd.org for regenerating syscalls.

Generated by ksh ./sys/openbsd/extract-openbsd.sh

* Undo whitespace change not passing on CI

* No need for magic script.
2018-10-29 18:59:16 +01:00
Dmitry Vyukov
fe65cc88ce sys/linux: fix SIOCGIFCONF const 2018-10-29 15:06:53 +01:00
Dmitry Vyukov
b36409b288 sys/linux: fix IP6T_SO_GET_INFO const
Fix copy-paste error.
2018-10-29 14:57:43 +01:00
Greg Steuck
7df9db2eb2 Conditionally enable test -race when supported on the OS. 2018-10-29 12:28:37 +01:00
Dmitry Vyukov
9ca2afa12c sys/linux: open /dev/media* files
Also remove the second syscall for opening of /dev/fd*.
2018-10-28 20:35:35 +01:00
Dmitry Vyukov
f00934a9ac sys/linux: add "ofb" crypto-something 2018-10-28 19:49:54 +01:00
Dmitry Vyukov
899726922e dashboard/config: update kernel configs
Enable:
CONFIG_BLK_DEV_FD
CONFIG_CRYPTO_OFB
CONFIG_VIDEO_VIMC
CONFIG_VIDEO_VIM2M
CONFIG_VIDEO_VIVID
CONFIG_VIDEO_VICODEC
2018-10-28 19:47:53 +01:00
Dmitry Vyukov
6ce28678e4 sys/linux: slightly refine perf descriptions
CPU argument can be -1.
It makes sense to mmap perf fd.
2018-10-28 19:22:46 +01:00
Dmitry Vyukov
6e045ca26d sys/syz-extract: support missing arch headers
The latest Linux kernel misses some arch-specific headers on some archs:
	asm/a.out.h
	asm/prctl.h
	asm/mce.h
Support that.
2018-10-28 19:10:11 +01:00
Dmitry Vyukov
6d8b3311b9 vm/qemu: don't use e1000 on arm64
arm64 uses virtio net by default and does not support e1000.
So don't override the default and use e1000 only for 386/amd64.
2018-10-28 19:07:22 +01:00
Dmitry Vyukov
4744d8ccac pkg/report: fix guilty file extraction
reportPrefixLen can become wrong after symbolization
if we symbolize any lines in the prefix.
Adjust reportPrefixLen during symbolization.

Automatic testing of this is problematic
because we would need to symbolize which requires
the object file with debug info.
Tested manually with syz-symbolize.
2018-10-28 19:07:22 +01:00
Dmitry Vyukov
75f4f60336 vm/qemu: use -cpu host,migratable=off
This exposes the maximum amount of features to the guest.
migratable=off exposes features that qemu does not know about too.
2018-10-28 19:07:22 +01:00
Denis Efremov
e6806d0f73 sys/linux: floppy interface description
For floppy fuzzing you need to enable:

1) CONFIG_BLK_DEV_FD in your kernel configuration
2) "cmdline": " -fda FLOPPY.img " in syzkaller configuration

Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Alexander Popov <alex.popov@linux.com>
2018-10-28 19:04:12 +01:00
Greg Steuck
24808096ca tools/create-openbsd*sh: use cdn.openbsd.org not cloudflare, install vmm-firmware
* Use cdn.openbsd.org not cloudflare. Install vmm-firmware explicitly.

* Use cdn.openbsd.org not cloudflare. Install vmm-firmware explicitly.

* set hw.smt=1: the underlying hw on VM is unknown so don't waste SMT.
2018-10-28 10:18:59 +01:00
Dmitry Vyukov
6f9b225ad9
Update syscall_descriptions.md
Clarify that running `make clean` each time is not necessary.
2018-10-28 10:11:22 +01:00
Dmitry Vyukov
8efba39a81
Update research.md 2018-10-27 13:55:09 +02:00
Dmitry Vyukov
e1430f1137
Update found_bugs.md 2018-10-27 13:52:47 +02:00
Dmitry Vyukov
a8292de958 gometalinter: ignore ALL_CAPS names in sys/openbsd/init.go
As we do for other OSes as they use OS constant names
which are usually ALL_CAPS.
2018-10-23 11:17:20 +01:00
Dmitry Vyukov
24fa2ad836
Update found_bugs.md 2018-10-23 11:08:48 +01:00
Dmitry Vyukov
ecb386fe6f sys: check that target consts are defined
Currently when we get target consts with target.ConstMap["name"]
during target initialization, we just get 0 for missing consts.
This is error-prone as we can mis-type a const, or a const may
be undefined only on some archs (as we have common unix code
shared between several OSes).
Check that all the consts are actually defined.
The check detects several violations, to fix them:
1. move mremap to linux as it's only defined on linux
2. move S_IFMT to openbsd, as it's only defined and used on openbsd
3. define missing MAP_ANONYMOUS for freebsd and netbsd
4. fix extract for netbsd
2018-10-19 19:11:22 +01:00
Bader AlBassam
9aba67b521 Added kernel config options for debian stretch 2018-10-18 14:10:53 +01:00
Nicolas Lacasse
d257b2d2d8 Pass -debug flag to runsc.
As of commit 3f053259, gVisor sentry panics are no longer sent to the
stderr for "runsc run" by default, as that stderr belongs exclusively to
the application.

As a result, syzbot never sees the gVisor panic stack trace, and is only
reporting errors that occur when waiting for a dead sandbox.

Passing the "-debug" flag to runsc will make the sentry panics visible
to syzbot again.
2018-10-17 21:43:37 +02:00
LA
b2695b95a8 Update configuration.md
VM parameters are not defined in config.go, I've found them in qemu.go instead.
Fix for the documentation to make it easier to find all supported parameters for qemu.
2018-10-17 21:14:15 +02:00
Dmitry Vyukov
1ba7fd7e65 all: fix code formatting
Reformat, remove debug leftovers, fix comment style.
2018-10-16 13:57:24 +02:00
Dmitry Vyukov
8cd30605ce tools/create-gce-image.sh: create ext4 image without journalling
We don't need consistent image after reboot since we always reimage.
We know of some use cases that don't use journalling, but don't know
of any that use journalling.
2018-10-15 18:56:55 +02:00
Dmitry Vyukov
6ce17935cb sys/linux: prohibit FAN_OPEN_PERM and FAN_ACCESS_PERM
FAN_OPEN_PERM and FAN_ACCESS_PERM require the program to reply to open requests.
If that does not happen, the program will hang in an unkillable state forever.
See the following bug for details:
https://groups.google.com/d/msg/syzkaller-bugs/pD-vbqJu6U0/kGH30p3lBgAJ
2018-10-15 18:53:00 +02:00
Zach Riggle
caf1290068 Android: Add simple test harness for Sandbox 2018-10-12 16:39:26 +02:00
Zach Riggle
751b7baf94 Android: Fix sandbox implementation
My test harness for this code performed some steps that are not
performed when syz-executor is invoked directy.

Specifcally, we need to operate from a directory under /data/data,
and have the correct UID/GID set as the owner of the directory.

My test harness now correctly sets these, all sandbox operations
succeed, and loop() is invoked.
2018-10-12 16:39:26 +02:00
Anton Lindqvist
6e32776909 docs/openbsd: update found_bugs.md 2018-10-12 16:33:42 +02:00
Dmitry Vyukov
ba6ddb4336 pkg/report: improve OpenBSD output parsing
OpenBSD produces \n\r for new lines and split output at 79 column.
Handle both of these things.
2018-10-11 19:47:32 +02:00
Dmitry Vyukov
98d7e0a90c docs: say that OpenBSD bugs are now reported by syzbot too 2018-10-11 19:47:32 +02:00
Dmitry Vyukov
c3772ff106 pkg/email, pkg/vcs: test that OpenBSD-style commits are handled
OpenBSD does not use "first line is title" convention,
so test that this is parsed properly.
Also test that multi-line fix/dup commands are properly parsed.
2018-10-11 19:47:32 +02:00
Anton Lindqvist
0e1a45faf7 docs/openbsd: use qcow2 disk format in setup 2018-10-11 19:47:20 +02:00
Anton Lindqvist
4b94574dd4 vm/vmm: use derived disks for VMs
As a result, the boot time is significantly improved since there's no longer any
need to copy the complete disk.

This feature was recently committed to OpenBSD-current. Any existing base image
used must be recreated, this time using the qcow2 disk format.
2018-10-11 19:47:20 +02:00
Greg Steuck
42c78641f5 tools/create-openbsd*: Support post-version flip snapshots.
* Fixed pkg_add status checking
  * Switched to qcow2 test image
  * Minor GC
2018-10-11 19:44:34 +02:00
Scott Graham
5f818b4b9f executor: Fuchsia: Use zx_task_resume_from_exception()
zx_task_resume() is deprecated; switch to using
zx_task_resume_from_exception() instead.
2018-10-10 19:45:24 +02:00
Dmitry Vyukov
700f14a4ab
Update setup.md
Update Go instructions for newer toolchain.
GOPATH and GOROOT are now optional, and we also need to add GOPATH/bin to PATH.
2018-10-10 19:38:02 +02:00
Dmitry Vyukov
7241510157
Update contributing.md
fix formatting
2018-10-10 19:26:51 +02:00
Dmitry Vyukov
ba8cd6d708 pkg/report: ignore arch/.*/mm/physaddr.c as guilty file
This is called from kfree in the added test.
We already ignore everything related to kmalloc/free
and e.g. arch/.*/mm/fault.c, so it looks reasonable
to ignore this one too.
2018-10-10 17:32:28 +02:00
Dmitry Vyukov
a9495352a0 pkg/host: improve KMEMLEAK detection
EBUSY is returned when KMEMLEAK is in fact turned off,
not when scanning is already turned off.
That can't be recovered.
So instead check that we can write to the file in the check
function and give useful diagnostics.
2018-10-10 15:38:06 +02:00
Dmitry Vyukov
fefd83bf0b tools/syz-execprog: show host features
syz-execprog -output is handy way to check what features host.Check detects.
2018-10-10 15:36:57 +02:00
Dmitry Vyukov
adedaf77a1 executor: tune memcg container logic
The current memcg container seems to lead to lots of hangs/stalls.
Presumably the problem is with oom_score_adj and KASAN.
Executor process tree eats all memory and then the leaf process is killed
but the memory is not returned to memcg due to KASAN quarantine;
and the parent processes are protected from killing with oom_score_adj=-1000.
As the result the kernel locks up.

1. Don't use oom_score_adj=-1000. Instead bump leaf process score to 1000 (kill always).
2. Increase size of memcg to be larger than expected KASAN quarantine size.
2018-10-10 14:22:09 +02:00
Dmitry Vyukov
1b410967ce syz-manager: don't upload failed leak repro attempts to dashboard
We did not upload the crash itself, so dashboard does not know about them.
2018-10-10 14:04:36 +02:00