Commit Graph

4533 Commits

Author SHA1 Message Date
Dmitry Vyukov
22535fecd5 pkg/compiler: don't mark flags with 0 as bitmask
They can't be a bitmask. This fixes important cases
of "0, 1" and "0, 1, 2" flags. Fix some descriptions
that added 0 to bitmasks explicitly (we should do it
automatically instead).
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
d412ea5e8e pkg/compiler: sort flags values
Will simplify runtime analysis of flags.
Also just no reason to make it more deterministic
and avoid unnecessary diffs in future if values are reordered.
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
132dcea0af pkg/compiler: generate const[0] for flags w/o values
Generate const[0] for flags without values and for flags
with a single value which is 0.
This is the intention in all existing cases (e.g. an enum with types
of something, but there is really only 1 type exists).
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
d2f8d5ab46 sys/linux: fix sigset_t/sigaction layout on arm
Update #590
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
773117bf81 tools/syz-check: also check arm/arm64
They mostly duplicate the warnings we already have for amd64/386.
But uncovered few very interesting local things (e.g. epoll_event
is packed only on amd64, so arm/arm64 layout is wrong, but 386
is correct because int64 alignment is different).

Update #590
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
2ec9a3ad9a sys/linux: update warn files
Just regenerate with current descriptions and current linux-next.
Few uninteresting changes.
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
a2af37f08c prog: increase encodingexec buffer size
Some of the programs involving netfilter syscalls
produce errors about insufficient buffer size. Bump it more.
2020-01-18 21:02:24 +01:00
Dmitry Vyukov
3de7aabbb7 pkg/vcs: disable CONFIG_DEBUG_KOBJECT during bisection
We disabled it in configs, now also disable during bisection.
This config only adds debug output. It should not be enabled at all,
but it was accidentially enabled on some instances for some periods of time,
and kernel is boot-broken for prolonged ranges of commits with deadlock
which makes bisections take weeks.
2020-01-16 11:31:02 +01:00
Dmitry Vyukov
f9b6950728 syz-manager: don't accept excessive amounts of inputs for a single call
From time to time we get corpus explosion due to different reason:
generic bugs, per-OS bugs, problems with fallback coverage, kcov bugs, etc.
This has bad effect on the instance and especially on instances
connected via hub. Do some per-syscall sanity checking to prevent this.
2020-01-15 18:04:24 +01:00
Dmitry Vyukov
0b7abdf922 syz-manager: don't send more than 100K inputs to hub
Never send more than 100K, this is never healthy but happens episodically
due to various reasons: problems with fallback coverage, bugs in kcov,
fuzzer exploiting our infrastructure, etc.
2020-01-15 18:04:24 +01:00
Dmitry Vyukov
4272e40b21 prog: don't add fallback coverage after clone+ptrace
clone+ptrace combo cause fallback coverage explosion under gvisor.
Mechanics of that are unclear, but effect is very clear.
2020-01-15 18:04:21 +01:00
Dmitry Vyukov
b803944b58 prog: don't add fallback coverage after prctl
The same reason as with seccomp.
2020-01-15 17:35:31 +01:00
Dmitry Vyukov
ba92288dcf executor: ignore prctl in fallback coverage
Some prctl commands don't respect the normal convention for return values
(e.g. PR_GET_TIMERSLACK, but there are more) and may produce all possible
errno values. This conflicts with fallback coverage.
2020-01-15 17:35:31 +01:00
Jann Horn
069a5a4486 pkg/report: add pattern for Linux #SS faults
On X86-64, dereferencing a non-canonical address normally causes a #GP, for
which syzkaller already has a pattern. However, if the base register of the
non-canonical address is RBP (which can happen in builds that use RBP as a
general-purpose register because they don't use frame pointer unwinding),
#SS is thrown instead, for which syzkaller did not yet have a pattern.

To see this kind of fault, you can insert the following code in
kernel_init() after the call to rcu_end_inkernel_boot():

	asm volatile(
		"movabs $0x8000000000000000, %rbp\n\t"
		"movq (%rbp), %rax\n\t"
		"ud2\n\t"
	);

Linux prints a different error message for #SS, so add that error message
to syzkaller's list of patterns.
2020-01-15 16:06:40 +01:00
Dmitry Vyukov
b67897d4d1 sys/linux: extend and improve NFNL_SUBSYS_NFTABLES descriptions 2020-01-15 16:06:10 +01:00
Andrew Turner
fa12bd3c2e pkg/report: Add the calling function to sx reports
These can fail in many functions, include the calling function in
the report
2020-01-14 19:55:46 +01:00
Dmitry Vyukov
02b6b5430a sys/linux: add NFNL_SUBSYS_NFTABLES descriptions 2020-01-14 19:55:25 +01:00
Dmitry Vyukov
23641f8d17 syz-manager: start VMs with a small delay
If lots of instances are started at the same time,
it slows down boot of every VMs and delays detection
of configuration bugs, etc. Start VMs with 10 sec delay,
so that checking happens faster.
2020-01-14 19:51:25 +01:00
Dmitry Vyukov
3288120597 sys/linux: add NFNL_SUBSYS_CTNETLINK_TIMEOUT descriptions 2020-01-13 18:02:45 +01:00
Andrey Konovalov
23f3478a8c executor: provide explicit values for usb_raw_event_type
To match the kernel uapi headers.
2020-01-13 16:14:45 +01:00
Dmitry Vyukov
99565c1a26 sys/linux: add NFNL_SUBSYS_ACCT descriptions 2020-01-13 07:58:58 +01:00
Dmitry Vyukov
76bd6dd281 sys/linux: add NFNL_SUBSYS_OSF descriptions 2020-01-13 07:58:56 +01:00
Dmitry Vyukov
53faa9fe74 sys/freebsd: fix ipv6_packet name
The common code now expects it to be called ipv6_packet_t.
The freebsd fork wasn't updated when the linux version changed.
2020-01-12 14:01:45 +01:00
Dmitry Vyukov
31290a4541 sys/linux: open more files from procfs 2020-01-12 11:13:18 +01:00
Andrey Konovalov
4c04afaa19 dashboard/config: update USB config 2020-01-10 15:46:17 +01:00
Dmitry Vyukov
29253134f2 dashboard/config: disable CONFIG_DEBUG_KOBJECT
This config only adds debug output, this is not useful for fuzzing.
2020-01-10 15:43:43 +01:00
Andrey Konovalov
532ec44e8d dashboard/config: update USB config 2020-01-10 15:21:05 +01:00
Dmitry Vyukov
2e0a9b2b70 dashboard/config: add Android 5.4 configs 2020-01-10 15:12:56 +01:00
Dmitry Vyukov
0e9d69622b dashboard/config: s/=m/=y/ in Android 5.4 config
Again to make the next diff more useful.
2020-01-10 15:12:56 +01:00
Dmitry Vyukov
fd4b785fbb dashboard/config: add Android 5.4 olddefconfig
This is just a result of running olddefconfig over arch/x86/configs/gki_defconfig.
Again to make the next diff more useful.
2020-01-10 15:12:56 +01:00
Dmitry Vyukov
9734d8e285 dashboard/config: add Android 5.4 baseline config
This config is incomplete and is unusable by syzbot.
But adding this file first will make diff for the real
config submitted in the next commit useful.
2020-01-10 15:12:56 +01:00
Dmitry Vyukov
f1d60fec2a dashboard/config: refactor config generation scripts
Refactor config generation scripts in preparation for generating Android configs.
2020-01-10 15:12:56 +01:00
Dmitry Vyukov
4de4e9f01d sys/linux: add NFNL_SUBSYS_ULOG descriptions 2020-01-09 15:13:17 +01:00
Dmitry Vyukov
a41d89c7c9 sys/linux: add NFNL_SUBSYS_QUEUE descriptions 2020-01-09 14:44:40 +01:00
Jonghyuk Song
ddc3e85997 vm/isolated: update isolated vm
* vm/isolated: update isolated vm

Old isolated.go cannot hard reset the target device when the target device is stuck,
because it used SSH command to reboot.
New isolated.go can reboot the target device using USB hub,
so it can reboot the device when its kernel is crashed during fuzzing.
It also doesn't require 'CGO' like odroid.go

* vm/isolated: set default Host, comment modification

* vm/isolated: restore ssh reboot in repair()

In the previous commit, ssh reboot is removed.
but it should be remained, so this commit restore the ssh reboot.
Now, repair() func can reboot the target using ssh or /sys/bus/usb/devices/.../authorized/

* vm/isolated: update USBdev rebooting method and etc, ...
- change reboot method from using /bin/sh to file method
- change USBDevNum to array type
- restore waiting time when rebooting

* vm/isolated: update USBdev rebooting method and etc, ...
- change reboot method from using '/bin/sh' to file i/o
- change USBDevNum to array type
- restore waiting time when rebooting

* vm/isolated: update USBdev rebooting method and etc, ...
- change reboot method from using '/bin/sh' to file i/o
- change USBDevNum to array type
- restore waiting time when rebooting

* vm/isolated: some fixes based on feedback
- change variable name: USBDevNum -> USBDevNums, USBAuth -> usbAuth
- check whether USBDevNums is empty in ctor(), repair()
- move usbAuth declaration from Create() to repair()

* vm/isolated: remove empty line

* vm/isolated: fix some conditions

* vm/isolated: change comment, add validate length of USBDevNums

* vm/isolated: check whether the len(USBDevNums) and len(Targets) is same

* vm/isolated: change repair() func based on review
- wait 30*time.Minute even if TargetReboot is not set.
- reduce/combine logs
- e -> err

* vm/isolated: In repair(), print error log and return error when ssh is failed
2020-01-08 09:28:19 +01:00
Andrey Konovalov
6738e0b30b dashboard/config: disable magic sysrq entirely
It can be reached over tty as well and those path ignore the sysrq_enabled
setting.
2020-01-07 16:17:17 +01:00
Andrey Konovalov
a20859865e pkg/report: add more ignored frames 2020-01-07 16:02:48 +01:00
Dmitry Vyukov
6a8d39b1f4 syz-manager: disable corpus rotation
Temporary disable corpus rotation b/c we suspect it negatively affects fuzzing.
But we don't have hard data, and the easiest way to check is to disable
and see what happens.

Update #1348
2020-01-07 16:01:39 +01:00
Andrey Konovalov
d8c45749bf
Update external_fuzzing_usb.md 2020-01-07 15:33:47 +01:00
Dmitry Vyukov
7042566e4b pkg/email: accept #syz- prefix for commands
Some users spell the command as "#syz-dup:".
Support this and few more variations.
2020-01-07 14:32:50 +01:00
Dmitry Vyukov
36860d8b25 prog: increase array size during mutation
We have strict upper bound of array size 10.
However, for netlink we frequently need lots of attributes in arrays.
Add a mutation that increases array size by few elements
without an upper bound (we should not grow them infinitely due
to coverage feedback?).
2020-01-07 14:31:14 +01:00
Dmitry Vyukov
d817520681 sys/linux: few minor ipset improvements.
1. Add "bitmap:port" type.
2. ipv4/6 addresses must be in network byte order.
2020-01-07 12:41:07 +01:00
Dmitry Vyukov
7824163310 pkg/vcs: disable CONFIG_DEBUG_INFO_BTF during bisection
BTF fails lots of builds with:
pahole version v1.9 is too old, need at least v1.13
Failed to generate BTF for vmlinux. Try to disable CONFIG_DEBUG_INFO_BTF.
2020-01-07 11:31:59 +01:00
Dmitry Vyukov
1bcd407ecb sys/linux: add ipset descriptions 2020-01-07 10:02:11 +01:00
Dmitry Vyukov
a0f466387d sys/linux: fix 2 netlink data layout bugs
1. Turns out that NLA_F_NESTED is actually used and checked
(nla_parse_nested checks it, while nla_parse_nested_deprecated does not).
Similarly, ipset extensively checks NLA_F_NET_BYTEORDER.
So we need these bits.

2. nla_len must not account for the trailing alighnment padding.
This means we set wrong len for payloads that are not multiple of 4
(int8/int16/strings/arrays/some structs/etc).
2020-01-07 10:02:10 +01:00
Dmitry Vyukov
d2bde102ff pkg/compiler: fix another bitfield layout bug
See the added test for details.
2020-01-07 10:02:09 +01:00
Andrey Konovalov
c43471c3ac pkg/repro: simplify C repros over DevlinkPCI 2020-01-07 10:02:02 +01:00
Andrey Konovalov
6738080fea executor: setns requires including sched.h on some setups 2020-01-07 10:02:02 +01:00
Anton Lindqvist
53430d9719 pkg/report: normalize kqueue_check report on OpenBSD 2020-01-06 20:37:03 +01:00
Dmitry Vyukov
438e122712 pkg/host: fix detection of enabled LSMs
securityfs may not be mounted, but it does not mean that no LSMs are enabled.
2020-01-05 17:48:19 +01:00