Commit Graph

2041 Commits

Author SHA1 Message Date
Dmitry Vyukov
a84f016776 sys/linux: don't touch mknod$loop during sanitization
mknod$loop contains proc type as dev number.
Current sanitization code truncates 64-bit -1 to 32-bits
which later causes validation failure.
Don't do that, it's unnecessary for proc type.
2018-01-16 13:43:44 +01:00
Dmitry Vyukov
b48312c59d syz-ci: retry test jobs up to 3 times
GCE can be buggy, kernel can be buggy.
2018-01-16 13:37:14 +01:00
Dmitry Vyukov
c206e64a01 syz-ci: use the original syzkaller commit for patch testing
Currently we use the latest syzkaller commit that syz-ci uses itself.
As the result syz-execprog can fail to deserialize the reproducer.
Use the original syzkaller commit.
2018-01-16 13:37:14 +01:00
Dmitry Vyukov
afcb994770 dashboard/app: rename attachments so they are sent as text/plain
Appengine sends only .txt/.diff files as text/plain.
Unknown extensions are send as application/octet-stream,
which is unacceptable.
I've opened a bug on appengine, but for now just rename them.
2018-01-16 13:37:14 +01:00
Dmitry Vyukov
9aaf64b374 docs: clarify that syzbot testing can be used for debugging 2018-01-16 13:37:14 +01:00
Dmitry Vyukov
4198e58824 vm/vmimpl: unbreak freebsd build
Also add freebsd/netbsd host build to presubmit.
2018-01-16 06:41:23 +01:00
Dmitry Vyukov
e17f4a5dfb sys/linux: generate GRE v0 packets even with incorrect payload 2018-01-15 20:26:04 +01:00
Dmitry Vyukov
47501d0f3b sys/linux: more NETLINK_ROUTE descriptions 2018-01-15 20:22:27 +01:00
Dmitry Vyukov
837a69870d pkg/report: add another TODO test case 2018-01-15 20:21:30 +01:00
Dmitry Vyukov
b705c02263 executor: fix tun/device setup for sandbox=namespace
For sandbox=namespace we first create network devices
and then do CLONE_NEWNS, which brings us into a new
namespace which actually does not have any of these devices.
Tun mostly worked, because we hold fd to the tun device.
However, even for tun we could not see the "syz0" device.
2018-01-15 19:09:16 +01:00
Dmitry Vyukov
b75f5cb3cb sys/linux: add AF_PPPOX descriptions 2018-01-15 18:39:05 +01:00
Dmitry Vyukov
46d78f4deb dashboard/app: don't warn about emails on closed bugs 2018-01-15 15:26:30 +01:00
Dmitry Vyukov
66d492a6c7 sys/linux: add vnet descriptions for GRE, MPLS, CAN 2018-01-14 16:23:39 +01:00
Dmitry Vyukov
33bb46947a sys/linux: more AF_NETLINK/NETLINK_ROUTE descriptions 2018-01-14 16:23:39 +01:00
Dmitry Vyukov
36e37bdf6c sys/linux: add broadcast/multicast mac addresses 2018-01-14 16:23:39 +01:00
Dmitry Vyukov
90c33e5d0c syz-manager: check new inputs from fuzzers
Fuzzer must not send broken programs, but we see such cases episodically.
Reason unknown. But at least prevent manager from crashing later.
2018-01-14 16:23:39 +01:00
Dmitry Vyukov
c9e7aeaef6 sys/linux: add AF_CAN descriptions 2018-01-13 12:52:09 +01:00
Dmitry Vyukov
1768ee71e6 executor: tidy up debug output
1. Don't print copyin (there are too many of them).
2. Print copyout value (it's usually important).
2018-01-13 12:52:09 +01:00
Dmitry Vyukov
e9aebc0683 sys/linux: add AF_NETLINK/NETLINK_ROUTE support 2018-01-13 12:52:09 +01:00
Dmitry Vyukov
212f927d3c executor: setup network devices
We test in a new network namespace, which does not have any
devices set up (even lo). Create/up as many devices as possible.
Give them some addresses and use these addresses in descriptions.
2018-01-13 12:52:09 +01:00
Dmitry Vyukov
9ea6693e1b pkg/compiler: allow string/array as template type 2018-01-13 12:52:09 +01:00
Dmitry Vyukov
a94baff95e sys/syz-sysgen: don't generate syz_ syscall numbers
They don't seem to be used today.
2018-01-13 12:52:09 +01:00
Dmitry Vyukov
1623c95de1 sys/syz-extract: don't run mrproper if already clean
mrproper takes unreasonable amount of time.
2018-01-13 12:52:09 +01:00
Dmitry Vyukov
125dadd3c9 sys/linux: use type templates for netlink
-350 lines of descriptions
2018-01-13 12:52:09 +01:00
Dmitry Vyukov
5585946e22 pkg/compiler: support void type
"void": type with static size 0
	mostly useful inside of templates and varlen unions
	can't be syscall argument
2018-01-13 12:52:09 +01:00
Dmitry Vyukov
6b52293f4d pkg/compiler: support type templates
Netlink descriptions contain tons of code duplication,
and need much more for proper descriptions. Introduce
type templates to simplify writing such descriptions
and remove code duplication.

Note: type templates are experimental, have poor error handling
and are subject to change.

Type templates can be declared as follows:

```
type buffer[DIR] ptr[DIR, array[int8]]
type fileoff[BASE] BASE
type nlattr[TYPE, PAYLOAD] {
	nla_len		len[parent, int16]
	nla_type	const[TYPE, int16]
	payload		PAYLOAD
} [align_4]
```

and later used as follows:

```
syscall(a buffer[in], b fileoff[int64], c ptr[in, nlattr[FOO, int32]])
```
2018-01-13 12:52:09 +01:00
Dmitry Vyukov
9dc808a65e pkg/ast: refactor Walk
Refactor Walk so that it's possible to abort or wrap walk of child nodes.
Will be needed for future changes.
2018-01-11 11:45:35 +01:00
Dmitry Vyukov
7a4d53c30f pkg/report: add test where we fail to provide good title 2018-01-11 11:45:35 +01:00
Dmitry Vyukov
a46637766b sys/linux: regenerate arm consts + small netlink fixed
Arm was broken on upstream kernel for some time
due to some assembler error. Now it seems to be fixed,
so regenerate consts.

Also fix small issues in new netlink descriptions.
2018-01-11 11:45:22 +01:00
Dmitry Vyukov
02a19b646c syz-manager: add comment explaining why we don't set corrupted for repros 2018-01-10 09:41:28 +01:00
Dmitry Vyukov
1f60c8289d sys/linux: add AF_NETLINK/NETLINK_NETFILTER descriptions 2018-01-09 21:24:30 +01:00
Dmitry Vyukov
6bfc81c142 syz-fuzzer: improve kmemleak support
Don't print object size (can change from kernel to kernel
and from config to config).
Fix function extraction regexp (must be non-eager).
Account for MSECS_MIN_AGE.
Ignore some known false positives.
2018-01-09 21:24:29 +01:00
Dmitry Vyukov
b88de8e0bf tools/syz-symbolize: allow to symbolize arbitrary kernel output 2018-01-09 21:24:29 +01:00
Dmitry Vyukov
94f8c64d03 sys/linux: add AF_NETLINK/NETLINK_GENERIC descriptions 2018-01-09 21:24:29 +01:00
Dmitry Vyukov
93bff6656f sys/linux: duplicate open/accept specializations with openat/accept4
open is not present on arm64, only openat.
accept is not present on 386, only accept4.
Duplicate all open/accept specializations with
corresponding openat/accept4 specializations
to enable testing on 386/arm64.
2018-01-09 21:24:29 +01:00
Dmitry Vyukov
b5f6354179 prog: add test for cross-arch deserialization
Few managers recently crashed with:

panic: syscall mknod$loop: per proc arg 'proc' has bad value '4294967295'
        panic: sync: unlock of unlocked mutex

goroutine 35438 [running]:
sync.(*Mutex).Unlock(0xc42166e0c8)
        sync/mutex.go:184 +0xc1
panic(0xb98980, 0xc448971aa0)
        runtime/panic.go:491 +0x283
main.(*Manager).Connect(0xc42166e000, 0xc42056d060, 0xc42038f000, 0x0, 0x0)
        syz-manager/manager.go:868 +0x11cc

And a similar issue was reported on mailing list.
It's unclear where these bogus programs come from.
It seems that hub was somehow involved here.
4294967295 is (uint32)-1 which is trucated special
value for proc types.
The test did not uncover any bugs, bug since I wrote it
and it looks like a useful test, let's commit it anyway.
2018-01-09 21:24:29 +01:00
Dmitry Vyukov
0b470f2254 sys/linux: add AF_NETLINK/NETLINK_CRYPTO descriptions 2018-01-09 21:24:29 +01:00
Dmitry Vyukov
7166c86520 sys/linux: add ion and ashmem devices support
Note: ion supercedes the old android interface,
which is moved to sys/android.
2018-01-09 21:24:28 +01:00
Dmitry Vyukov
5aac8b06c6
Update found_bugs.md 2018-01-09 19:57:15 +01:00
Dmitry Vyukov
a7899a5895
Update found_bugs.md 2018-01-09 17:12:16 +01:00
Dmitry Vyukov
11dc42f69d dashboard/app: fix reporting filter skipping
We must not skip reporting if we already reported a bug to it.
This leaves orphaned bugs.
2018-01-08 13:39:47 +01:00
Dmitry Vyukov
cb9c49e859 syz-fuzzer: separate programs in output by newline
Greatly improves log readability at a cost of minimal size increase.
2018-01-08 13:20:44 +01:00
Dmitry Vyukov
1014e5506e pkg/report: ignore kernel/workqueue.c as guilty file 2018-01-08 12:56:44 +01:00
Dmitry Vyukov
66288e0e0b pkg/compiler: add builtin bool type aliases
This adds builtin:

type bool8 int8[0:1]
type bool16 int16[0:1]
type bool32 int32[0:1]
type bool64 int64[0:1]
type boolptr intptr[0:1]

We used to use just int's for bools.
But bool types provide several advantages:
 - make true/false probability equal
 - improve description expressiveness
 - reduce search space (we will take advantage of this later)
2018-01-08 12:52:31 +01:00
Dmitry Vyukov
0ae499850c sys/linux: add type aliases for complex xfrm types 2018-01-08 12:52:31 +01:00
Dmitry Vyukov
95a1be6aa4 sys/linux: resolve few TODOs 2018-01-08 12:52:31 +01:00
Dmitry Vyukov
8ac12551c2 sys/linux: add type alias for socket port
type sock_port proc[20000, 4, int16be]

That was repeated a few times.
2018-01-08 12:52:31 +01:00
Dmitry Vyukov
f01cb93788 pkg/compiler: make signalno a type alias
We don't need compiler support for such things anymore,
now we simply can do:

type signalno int32[0:65]
2018-01-08 12:52:31 +01:00
Dmitry Vyukov
402a0dc87e sys: support type aliases (aka typedefs)
Complex types that are often repeated can be given short type aliases using the
following syntax:

```
type identifier underlying_type
```

For example:

```
type signalno int32[0:65]
type net_port proc[20000, 4, int16be]
```

Then, type alias can be used instead of the underlying type in any contexts.
Underlying type needs to be described as if it's a struct field, that is,
with the base type if it's required. However, type alias can be used as syscall
arguments as well. Underlying types are currently restricted to integer types,
`ptr`, `ptr64`, `const`, `flags` and `proc` types.
2018-01-08 12:52:31 +01:00
Dmitry Vyukov
93b4c6f135 pkg/report: add few more test cases where we fail 2018-01-08 12:46:51 +01:00