Commit Graph

1925 Commits

Author SHA1 Message Date
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
Dmitry Vyukov
19c05fffcb dashboard/app: receive and log email bounces 2018-01-06 18:35:36 +01:00
Dmitry Vyukov
07703435fa dashboard/app: limit error log line length 2018-01-06 18:34:38 +01:00
Dmitry Vyukov
8dc787547e pkg/report: add tests where we produce bad title 2018-01-06 17:40:52 +01:00
Dmitry Vyukov
a8927abe6c prog: support opt for proc types 2018-01-06 17:40:49 +01:00
Dmitry Vyukov
8a67aa70b0 prog: add test for len mutation
Test we actually can get an unnatural len value.
2018-01-06 17:40:43 +01:00
Dmitry Vyukov
8e6b9eeb27 pkg/compiler: add bitsize type
This is need for few crypto/xfrm descriptions.
2018-01-06 17:40:36 +01:00
Dmitry Vyukov
bb0359b914 pkg/ipc: always prepend handshake errors with executor pid
Helps to understand what program caused it.
2018-01-06 17:39:19 +01:00
Dmitry Vyukov
7a2f0c7927 syz-manager/mgrconfig: add builtin suppression for crashing init 2018-01-06 17:38:44 +01:00
Dmitry Vyukov
053171eaf2 pkg/csource: fix build of generated files
On another machine both clang and gcc produce:

test.c:163:32: error: invalid suffix "+procid" on integer constant
       *(uint32_t*)0x20001004 = 0x25dfdbfe+procid*4;

Not sure why this wasn't caught on buildbot.
2018-01-06 15:26:40 +01:00
Dmitry Vyukov
7b28cc9307 pkg/report: add few tests where we mis-detect title/guilty file 2018-01-06 15:10:54 +01:00
Dmitry Vyukov
342feda2bf pkg/report: don't treat CONFIG_DEBUG_OBJECTS debug output as bugs 2018-01-06 14:54:09 +01:00
Dmitry Vyukov
0019344752 prog: detect argument type mismatch during deserialization 2017-12-31 12:49:20 +01:00
Dmitry Vyukov
71ed63015c prog: mutate len arguments
Fixes #183
2017-12-31 12:29:08 +01:00
Dmitry Vyukov
6bfd4f1979 sys/linux: netlink xfrm support 2017-12-31 12:11:12 +01:00
Dmitry Vyukov
bb6384b81a sys/linux: add multicast and ipv4 mapped ipv6 addresses 2017-12-29 22:14:12 +01:00
Dmitry Vyukov
dde1ffd49b sys/linux: describe ipv6 tlv options 2017-12-29 18:50:08 +01:00