Commit Graph

4618 Commits

Author SHA1 Message Date
Dmitry Vyukov
135c18aadb tools: add script that checks copyright headers
Fixes #1604
2020-02-18 16:05:10 +01:00
Dmitry Vyukov
012fbc3229 sys/linux: add descriptions of wireguard packets 2020-02-18 10:31:04 +01:00
Dmitry Vyukov
d52d4872e3 sys/linux: don't extract from futex.txt and watch_queue.txt
These are not present in linux-next.
2020-02-18 10:31:03 +01:00
Dmitry Vyukov
105edea6a3 sys/linux: fix udp test
Fix the packet injection in udp test.
Now we know how to do it!
And without IFF_NAPI_FRAGS it actually reaches the socket.

Update #1594
2020-02-18 10:31:02 +01:00
Dmitry Vyukov
39cd0f85a1 executor: disable IFF_NAPI_FRAGS
Update #1594
2020-02-18 10:31:02 +01:00
Dmitry Vyukov
b97f1e694a sys/linux: add broadcast mac address
Code in net/ethernet/eth.c does this:

__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
{
...
	if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
					      dev->dev_addr))) {
		if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) {
			if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast))
				skb->pkt_type = PACKET_BROADCAST;
			else
				skb->pkt_type = PACKET_MULTICAST;
		} else {
			skb->pkt_type = PACKET_OTHERHOST;
		}
	}

Multicast and broadcast are distinct and dev->broadcast seems to be ffffffffffff
by default, so add another multicast mac address that will serve as PACKET_MULTICAST.
2020-02-18 10:31:02 +01:00
Christoph Paasch
1ce142dcc7 dashboard/config: Add CONFIG_MPTCP to default configs and update to 5.6-rc1 2020-02-17 19:32:41 +01:00
Dmitry Vyukov
ed8812ac86 executor: refactor extra cover handling
One observation is that checking for extra cover is very fast
(effectively a memory load), so we can simplify code by removing
th->extra_cover and just check for it always. Additionally, we may
grab some coverage that we would miss otherwise.

Don't sleep for 500 ms at the end if colliding,
we are not going to use the extra coverage in that case anyway.

Check for extra coverage at the end every 100ms to avoid
being killed on timeout before we write any.

Make the 500ms sleep at the end parametrizable.
Enable it for syz_usb syscalls, so we get the same behavior for usb.

But this also allows to get extra coverage for other subsystems.
Some subsystems don't have a good way to detect if we will get any
extra coverage or not. Sleeping for 500ms for all programs slows down
fuzzing too much. So we check for extra coverage at the end for all
programs (cheap anyway), but sleep only for usb program.
This allows to collect extra coverage for vhost and maybe wireguard in future.

Update #806
2020-02-17 13:12:18 +01:00
Dmitry Vyukov
72bfa6f2b7 docs: fix go get instructions 2020-02-17 12:15:46 +01:00
Dmitry Vyukov
a416e6ee33 dashboard/app: remove stub test
This is not needed anymore since we don't have build tags on all test files.
2020-02-17 10:12:32 +01:00
Dmitry Vyukov
2b41159686
dashboard/config: add instructions on updating linux config 2020-02-17 06:27:36 +01:00
André Almeida
d0d8e8bc77
sys/linux: add new FUTEX_WAIT_MULTIPLE operation
Create individual file for futex syscall and add description for the new
operation FUTEX_WAIT_MULTIPLE.

Signed-off-by: André Almeida <andrealmeid@collabora.com>
2020-02-17 06:27:23 +01:00
Dmitry Vyukov
1f448cd62d
docs: minor formatting in syscall_descriptions_syntax.md 2020-02-16 12:14:55 +01:00
Paul Chaignon
cf9142006b sys/linux: add map batch operations
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
2020-02-16 10:22:29 +01:00
Paul Chaignon
88f115c969 sys/linux: update BPF constants and structures
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
2020-02-16 10:22:29 +01:00
Dmitry Vyukov
5d7b90f1af vm/gvisor: fix potential deadlock
Fixes #1591
2020-02-13 18:13:37 +01:00
Jason A. Donenfeld
c5ed587f4a
wireguard: setup some initial devices in a triangle
* wireguard: setup some initial devices in a triangle

The fuzzer will wind up undoing some of this, which is fine, but at
least it now has the chance of hitting some other paths it wasn't
before.

Closes: #1599

* wireguard: make code ugly after `make generate` pass

* wireguard: get rid of unused structs that are still interesting

* wireguard: compile in C++ mode with gcc 7

Complex designated initializers are only supported in C++ mode from gcc
8, and for whatever reason syzkaller wants to be compiled in C++ mode.

* wireguard: add braces around debug statements for checker

* wireguard: regenerate go source
2020-02-13 15:28:57 +01:00
Dmitry Vyukov
e624765350 pkg/csource: don't print too much error output
We print whole reproducer programs on failure,
if lots of programs fail, this results in thousands
of lines of output, which is esp bad on travis.
Limit amount of output.
2020-02-13 13:26:26 +01:00
Dmitry Vyukov
84f4fc8afc sys/linux: add SO_BINDTODEVICE specialization for wireguard
SO_BINDTODEVICE for wg devices allows to reach very important
part of functionality (wg_xmit).

Update #806
2020-02-12 11:50:15 +01:00
Dmitry Vyukov
a75b198cd0
doc: mention darwin support for coverage 2020-02-11 18:29:03 +01:00
Leo Neat
8de037321c
CIFuzz: surface error logs and test case on failure
* UX update

* Turning dry_run off

* Changing zip output to artifacts
2020-02-11 18:19:35 +01:00
Jason A. Donenfeld
4d1ab643be
sys/linux: restrict wireguard allowedips cidr size
By keeping this small, it means much greater probability that a randomly
generated packet that hits xmit will match an existing peer.
2020-02-11 15:12:17 +01:00
Andrey Konovalov
084454aecd dashboard, sys: update USB config 2020-02-11 02:19:31 +01:00
Dmitry Vyukov
d9e55b056e sys/linux/test: add few tests for UDP
Update #1594
2020-02-10 18:35:43 +01:00
Dmitry Vyukov
18847f55bb pkg/ast: introduce hex-encoded string literals
The stringnozescapes does not make sense with filename,
also we may need similar escaping for string flags.
Handle escaped strings on ast level instead.
This avoids introducing new type and works seamleassly with flags.

As alternative I've also tried using strconv.Quote/Unquote
but it leads to ugly half-escaped strings:
"\xb0\x80s\xe8\xd4N\x91\xe3ڒ,\"C\x82D\xbb\x88\\i\xe2i\xc8\xe9\xd85\xb1\x14):M\xdcn"

Make hex-encoded strings a separate string format instead.
2020-02-10 14:45:20 +01:00
Dmitry Vyukov
d0da558cb1 sys/linux: dump netdev_addr_id for wg2
Commit "wireguard: use wg0, wg1, wg2" added wg2,
bump netdev_addr_id accordingly.
2020-02-10 10:52:58 +01:00
Dmitry Vyukov
6805e90523 executor: increase input buffer size
I bumped input buffer size on Go side in:
a2af37f0 prog: increase encodingexec buffer size
But I forgot to increase the size on the executor side.
Do this and add comments re keeping them in sync.
2020-02-10 10:51:25 +01:00
Jason A. Donenfeld
b97dee873b pkg/compiler: allow for escaped strings
This adds stringnozescapes to allow parsing of escape sequences in
strings.
2020-02-10 10:51:16 +01:00
Jason A. Donenfeld
4f86d32773 wireguard: use wg0, wg1, wg2
This matches more closely what people are used to dealing with. We also
add one additional device for interesting multi-interface effects.
2020-02-10 10:51:16 +01:00
Jason A. Donenfeld
2c71f1a912 wireguard: increase chance that public and private will correspond
This tests more edge cases, as well as allowing for potentially a
correponding public and private key to be installed.
2020-02-10 10:51:16 +01:00
Dmitry Vyukov
35f5e45ed3 docs: fix link to usb keyboard.c
File /tools/syz-usbgen/keyboard.c linked from ./docs/linux/external_fuzzing_usb.md not found
Makefile:351: recipe for target 'check_links' failed
2020-02-09 14:09:19 +02:00
Dmitry Vyukov
553630e1a9 pkg/ipc: remove use of unsafe
Unsafe is, well, unsafe.
Plus it fails under the new checkptr mode in go1.14.
Remove some uses of unsafe.
2020-02-09 14:09:19 +02:00
Dmitry Vyukov
eb99c7d3da prog: remove use of unsafe
Unsafe is, well, unsafe.
Plus it fails under the new checkptr mode in go1.14.
Remove use of unsafe.

No statistically significant change in performance:

name            old time/op  new time/op  delta
StoreLoadInt-8  21.2ns ± 5%  21.6ns ± 9%   ~     (p=0.136 n=20+20)
2020-02-09 14:09:19 +02:00
Dmitry Vyukov
4f453297df .travis.yml: add go1.14rc1 2020-02-09 14:09:19 +02:00
Kamil Rytarowski
6ece2ea51d docs/netbsd: Improve wording.
Based on input from Maxime Villard (NetBSD).
2020-02-09 10:14:07 +01:00
Leo Neat
06150bf1b3 Update workflow to reflect new CIFuzz format 2020-02-07 00:15:47 +01:00
Andrey Konovalov
c321812877 docs: link github.com/xairy/raw-gadget 2020-02-06 19:34:17 +01:00
Andrey Konovalov
c91cbc9d22
Update coverage.md 2020-02-06 13:43:25 +01:00
Jouni Hogander
4bf48b4f49 docs: Add coverage documentation
Getting coverage working on cross-arch environment is currently
not documented at all. Also coverage presentation in the web-ui
is unclear. This document addition addresses these
2020-02-06 13:11:14 +01:00
Christian Brauner
5be3a391ba sys/linux: add new pidfd_getfd syscall
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-02-06 12:38:23 +01:00
Leo Neat
662cf49ae3 Adding action to workflow 2020-02-05 14:29:19 +01:00
Dmitry Vyukov
93e5e33559 pkg/report: update parsing of rcu stalls in ioctls
vfs_ioctl is now inlined somethimes...
2020-02-02 12:56:15 +01:00
Dmitry Vyukov
2274ad39c8 README: add proper syzkaller pronunciation
On popular request...
2020-02-01 12:34:56 +01:00
Dmitry Vyukov
0ee6c37319
docs: give syscall description language a name
It is a real language. We have a real compiler. It deserves a name.
Also useful for shorter references.

I hereby give it a name: syzlang.
2020-02-01 12:10:29 +01:00
Dmitry Vyukov
692266c73a sys/linux: use literal consts instead of hardcoded number 2020-02-01 11:33:32 +01:00
Christoph Paasch
326d4c7836 sys/linux: add IPPROTO_MPTCP support
Adding support for IPPROTO_MPTCP. Like SMC, it is on top of TCP and can
thus be treated like a regular TCP socket.
2020-02-01 11:14:31 +01:00
Dmitry Vyukov
0eb59c2768 sys/linux: regenerate files 2020-01-31 19:31:55 +01:00
Dmitry Vyukov
c30117b2ac pkg/report: don't attribute deadlocks to workqueue functions
In all cases we seen deadlocks in workqueue functions are related
to the subsystem that submits work items.
2020-01-31 19:14:47 +01:00
Dmitry Vyukov
96ce537b15 sys/linux: add some wireguard descriptions
Update #806
2020-01-31 19:12:16 +01:00
Dmitry Vyukov
5ed23f9aa6 dashboard/app: skip tests if dev_appserver.py is missing
Travis is not the right check. We also don't have dev_appserver.py
anywhere on syzbot, so builds fail. Check presence of dev_appserver.py
explicitly.
2020-01-29 16:15:37 +01:00