Commit Graph

1187 Commits

Author SHA1 Message Date
Dmitry Vyukov
5de34a784c pkg/compiler: don't specify syscall consts for test OS
This is just tedious. Fabricate them on the fly.
2020-03-17 21:19:13 +01:00
Andrey Konovalov
d89275f2aa executor, sys/linux: add ath9k usb descriptions
Among other things this changes timeout for USB programs from 2 to 3 seconds.

ath9k fuzzing also requires ath9k firmware to be present, so system images
need to be regenerated with the updated script.
2020-03-13 07:44:43 +01:00
Anton Lindqvist
b655d91b8c sys/openbsd: prevent killing the ssh VM connection
This is one of the root causes of the 'no output from test machine'
panic. Issuing a DIOCKILLSTATES ioctl on a /dev/pf file descriptor will
cause state associated with ongoing connections to be purged;
effectively killing the ssh connection to the VM.

Including net/pfvar.h is necessary in order to make use of the
DIOCKILLSTATES define.
2020-03-05 09:14:28 +01:00
Andrey Konovalov
576fb9bc34 sys, docs: rename syzcall to pseudo-syscall 2020-03-04 19:28:09 +01:00
Anton Lindqvist
09d53fbb27 sys/syz-extract: favor clang on OpenBSD
Clang is the default compiler on amd64 which is the only supported
architecture by syzkaller right now.
2020-03-04 18:27:18 +01:00
Anton Lindqvist
9ef240be5f sys/syz-extract: fix handling of odd prefixed syscalls on OpenBSD
This makes syz-extract work again on OpenBSD.
2020-03-04 18:27:18 +01:00
Anton Lindqvist
4fb7265b97 sys/openbsd: remove unused define 2020-03-04 18:27:18 +01:00
Dmitry Vyukov
2ffa6679c4 sys/linux: add NETLINK_SOCK_DIAG descriptions
Incomplete, but something.
2020-02-21 19:09:56 +01:00
Dmitry Vyukov
4428511d10 sys/linux: add NETLINK_RDMA descriptions 2020-02-21 17:38:10 +01:00
Dmitry Vyukov
ed54dfe305 sys/linux: add NETLINK_AUDIT descriptions 2020-02-21 11:32:08 +01:00
Dmitry Vyukov
82d32c2951 sys/syz-extract: fix output formatting
Remove spaces in the beginning of the message.
The message is actually multi-line and the spaces
are added only before the first line, which makes
the subsequent lines inconsistently offsetted.
2020-02-21 11:19:15 +01:00
Dmitry Vyukov
b6ed147834 prog: dump orig prog if Deserialize panics
We are seeing some one-off panics during Deserialization
and it's unclear if it's machine memory corrpution or
an actual bug in prog. I leam towards machine memory corruption
but it's impossible to prove without seeing the orig program.

Move git revision to prog and it's more base package
(sys can import prog, prog can't import sys).
2020-02-21 10:22:07 +01:00
Dmitry Vyukov
bd2a74a31f sys/linux: add smc_pnetid genetlink descriptions 2020-02-20 18:42:57 +01:00
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
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
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
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
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
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
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
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
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
96ce537b15 sys/linux: add some wireguard descriptions
Update #806
2020-01-31 19:12:16 +01:00
Dmitry Vyukov
d14236bc0a sys/linux: fix drm_mode_fb_cmd2 layout
Thanks to syz-check for catching this.

Update #590
2020-01-28 15:37:49 +01:00
Dmitry Vyukov
5e48183c6e sys/linux: add ethtool netlink descriptions 2020-01-28 15:08:47 +01:00
Dmitry Vyukov
56cd6c9b80 sys/linux: add time namespace descriptions 2020-01-27 15:18:15 +01:00
Dmitry Vyukov
dd56146d26 prog: remove unused ResourceDesc.Type 2020-01-26 11:30:18 +01:00
Dmitry Vyukov
55da6462ff pkg/serializer: do not write field names if it won't save space
If we are going to write all values, don't write field names.
This only increases size of generated files.
The change reduces size of generated files by 5.8%
(62870496-59410354=3460142 bytes saved).
2020-01-26 11:07:18 +01:00
Dmitry Vyukov
f4e7270e33 sys/linux: extend DRM ioctl descriptions
+ disable binderfs (see comments)
+ add few more missing tty ioctls
+ improve few minor things in hci descriptions
2020-01-25 22:30:06 +01:00
Dmitry Vyukov
11ebf937fc sys/linux: restore FOU_ATTR_LOCAL/PEER_V6
They are being fixed in kernel:
https://lists.openwall.net/netdev/2020/01/23/122
2020-01-23 15:05:22 +01:00
Dmitry Vyukov
8d11a11a30 sys/linux: improve infiniband_rdma descriptions 2020-01-23 15:05:21 +01:00
Dmitry Vyukov
0e8428d26f tools/syz-check: add limited checking of varlen structs
Stop at the fist varlen field, but check the preceeding ones.
Frequently the varlen array is the last field,
so we should get good checking for these cases.

Update #590
2020-01-23 15:05:21 +01:00
Dmitry Vyukov
9ab9b329d9 sys/linux: check for missing/duplicate netlink attrs
Update #590
2020-01-23 15:05:20 +01:00
Dmitry Vyukov
46961c2ff5 sys/linux: fix more netlink warnings
Handle NLA_BITFIELD32.
Match string attribtues better.
Calculate and check min size for varlen structs.
Fix NLA_UNSPEC size check.
Fix some things in descriptions.

Update #590
2020-01-23 15:05:19 +01:00
Dmitry Vyukov
3334d684ce sys/linux: fix incorrect nlattr sizes
Update #590
2020-01-22 18:31:20 +01:00
Dmitry Vyukov
f5fe1f1fcf sys/linux: more fixing of netlink policy names
Update #590
2020-01-22 18:31:20 +01:00
Dmitry Vyukov
2bdcee05b5 sys/linux: mark all nested netlink attributes as nlnest
As far as I understand most subsystems don't care about
the nest flag, but some do. But marking them as nest
won't harm (?). Let's mark all of them.

Caught several cases where should have been used array[policy]
but used just policy.

Update #590
2020-01-22 18:31:19 +01:00
Dmitry Vyukov
e4c56f390e tools/syz-check: improve matching netlink attributes
1. Match policies that has a _suffix in our descriptions
(we frequently do this to improve precision or avoid dup names).
2. Rename policies in descriptions to match kernel names.
3. Match policy if there are several such names in kernel.
4. Recognize policies with helper sub-policies.

Update #590
2020-01-22 18:31:15 +01:00