Commit Graph

1427 Commits

Author SHA1 Message Date
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
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
b67897d4d1 sys/linux: extend and improve NFNL_SUBSYS_NFTABLES descriptions 2020-01-15 16:06:10 +01:00
Dmitry Vyukov
02b6b5430a sys/linux: add NFNL_SUBSYS_NFTABLES descriptions 2020-01-14 19:55:25 +01:00
Dmitry Vyukov
3288120597 sys/linux: add NFNL_SUBSYS_CTNETLINK_TIMEOUT descriptions 2020-01-13 18:02: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
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
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
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
Dmitry Vyukov
d83499aa56 sys/linux: add NFNL_SUBSYS_CTHELPER/NFNL_SUBSYS_CTNETLINK_EXP descriptions 2020-01-05 17:15:59 +01:00
Dmitry Vyukov
d646e21ff4 prog: fix tests for string enforcement
String value enforcement broke a number of tests
where we use different values.
Be more string as to what string values we use in tests.
Required to add tmpfs descriptions to test syz_mount_image.
Also special-casing AF_ALG algorithms as these are auto-generated.
2020-01-05 12:50:29 +01:00
Dmitry Vyukov
c5f5069930 sys/linux: add AF_NETLINK/NETLINK_NETFILTER/NFNL_SUBSYS_CTNETLINK descriptions 2020-01-05 11:46:36 +01:00
Dmitry Vyukov
026aaeb2b5 prog: don't mutate strings with enumerated values
Strings with enumerated values are frequently file names
or have complete enumeration of relevant values.
Mutating complete enumeration if not very profitable.
Mutating file names leads to escaping paths and
fuzzer messing with things it is not supposed to mess with as in:

r0 = openat$apparmor_task_exec(0xffffffffffffff9c, &(0x7f0000000440)='/proc/self//exe\x00', 0x3, 0x0)
2020-01-05 11:46:35 +01:00
Dmitry Vyukov
9c216c0182 sys/linux: add vlan/macvlan/ipvlan/mactap device policies 2020-01-03 21:35:40 +01:00
Dmitry Vyukov
76d86b16e6 executor: setup vlan/macvlan/ipvlan devices 2020-01-03 19:01:39 +01:00
Dmitry Vyukov
b485b85127 sys/linux: add basic AF_PHONET descriptions 2020-01-03 17:36:36 +01:00
Dmitry Vyukov
b2a0884c1b sys/linux: add minimal AFS descriptions 2020-01-03 17:04:29 +01:00
Dmitry Vyukov
8ff25100c2 sys/linux: add 80211 descriptions 2020-01-03 16:11:49 +01:00
Dmitry Vyukov
7ec787382c sys/linux: fix SIOCGIFINDEX
Mark ifindex as opt in SIOCGIFINDEX.
Otherwise it's considered inout and SIOCGIFINDEX can't be used
to produce ifindex'es on its own. It requires an input ifindex
first and only then it can output own ifindex.
2020-01-03 16:11:49 +01:00
Dmitry Vyukov
fca6a74d0c executor: connect virt_wifi to veth
virt_wifi docs say that the enslaved device won't be usable
on itself. It's probably not a good idea to make lo unusable.
Enslave a dedicated veth instead.
2020-01-03 16:11:49 +01:00
Dmitry Vyukov
4e3e3c8d4b sys/linux: add netlabel descriptions 2020-01-03 16:11:49 +01:00
Dmitry Vyukov
21d4f173c5 sys/linux: improve ipv4/ipv6 vnet descriptions
1. Use optional[T] instead of array[T, 0:1].
2. Deduplicate 3 copies of ARP packet.
3. Deduplicate IPOPT_LSRR/IPOPT_SSRR/IPOPT_RR.
4. More precise description of IPOPT_TIMESTAMP/IPOPT_LSRR/IPOPT_SSRR/IPOPT_RR.
5. Don't use IPOPT_END/IPOPT_NOOP in generic option (they have different format).
6. Restrict cipso doi values.
7. Fix IPOPT_RA value type (int16 instead of int32).
8. Match ipv4/ipv6 packet type with payload.
9. Prefer 0 frag_off for ipv4 packets (they are extremely hard to get right).
2020-01-03 16:11:49 +01:00
Dmitry Vyukov
25a0186eba sys/linux: add IPPROTO_L2TP descriptions 2019-12-31 10:52:22 +01:00
Dmitry Vyukov
7f117e28b8 sys/linux: add virt_wifi and xfrm devices
+ some netlink descriptions
2019-12-30 20:18:14 +01:00
Dmitry Vyukov
6b36d33868 syz-manager: corpus rotation
Use a random subset of syscalls/corpus/coverage for each individual VM run.
Hypothesis is that this should allow fuzzer to get more coverage
find more bugs in saturated state (stuck in local optimum).
See the issue and comments for details.

Update #1348
2019-12-30 16:37:38 +01:00
Dmitry Vyukov
28a9676c17 sys/linux: add {MSG,SEM,SHM}_STAT_ANY 2019-12-30 16:37:38 +01:00
Dmitry Vyukov
be5c2c8197 sys/linux: fix 32-bit warnings
Lots of interesting findings...
Especially 2 byte uid/gid/pid.

Update #590
2019-12-23 10:56:16 +01:00
Dmitry Vyukov
4b042b7d67 sys/linux: fix int64 alignment on 386
Turns out int64 alignment is 4 on 386...
But on arm it's still 8.

Another amusing finding thanks to syz-check.

Update #590
2019-12-23 08:57:42 +01:00
Dmitry Vyukov
61f4e7ee54 tools/syz-check: check amd64 and 386 at the same time
Update #590
2019-12-22 19:34:12 +01:00
Dmitry Vyukov
8b96726707 sys/linux: fix warnings in template definition
Update #590
2019-12-22 11:39:02 +01:00
Dmitry Vyukov
c5907f7c7a tools/syz-check: check templates
Also rename some netfilter types to eliminate massive amounts of template warnings.

Update #590
2019-12-22 11:19:49 +01:00
Dmitry Vyukov
9b81e6bdb8 sys/linux: fix warning in dev_video4linux.txt
Update #590
2019-12-22 10:15:24 +01:00
Dmitry Vyukov
8fecec2eb0 sys/linux: another batch of warning fixes
The only remaining part now is dev_video4linux.txt

Update #590
2019-12-22 09:29:44 +01:00
Dmitry Vyukov
bfdfc2603c prog: don't fail decoding on non-default out args
We get them in cross-compilation test where an out const
arg has different values in different archs.
No reason to fail deserialization in that case, replace with default
arg instead.
2019-12-21 14:53:37 +01:00
Dmitry Vyukov
bc5869180f sys/linux: fix 240 warnings in descriptions
Sweeping fix of everything up to socket_netlink_route.txt.

Update #590
2019-12-20 16:45:35 +01:00
Dmitry Vyukov
f83f92fd5e tools/syz-check: inject description compilation warnings
Currently we print them as part of `make genereate`,
but nobody reads them, too much output each time.
Don't print them in `make generate` and instead
print in syz-check, the warn files are a good mechanism
to handle "known warnings".
2019-12-20 16:45:34 +01:00
Dmitry Vyukov
ae5ed0b140 pkg/compiler: fix bitfield layout bug
Fixes #1542

Found thanks to syz-check. Update #590
2019-12-20 16:45:34 +01:00
Dmitry Vyukov
4bba9fd162 pkg/compiler: fix alignment of string-formatted values
We used size as alignment, this is very wrong.

Found thanks to syz-check. Update #590
2019-12-20 16:45:34 +01:00
Dmitry Vyukov
08f0467614 sys/test: and another set of bitfield tests
Just trying to get my head around it (and fix this in tests).

Update #1542
2019-12-20 16:45:33 +01:00
Dmitry Vyukov
e30cbdae48 sys/test: and another bitfield test
Just trying to get my head around it (and fix this in tests).

Update #1542
2019-12-19 20:00:44 +01:00
Dmitry Vyukov
20c6855484 prog: refactor bitfields representation
All callers of BitfieldMiddle just want static size (0 for middle).
Make it so: Size for middle bitfields just returns 0. Removes lots of if's.
Introduce Type.UnitSize, which now holds the underlying type for bitfields.
This will be needed to fix #1542 b/c even if UnitSize=4 for last bitfield
Size can be anywhere from 0 to 4 (not necessary equal to UnitSize due to overlapping).
2019-12-19 19:32:45 +01:00
Dmitry Vyukov
af9047c60a sys/linux: prohibit TIOCSSERIAL
Replace TIOCSSERIAL with TIOCGSERIAL.
TIOCSSERIAL can do nasty things under root, like causing writes to random memory
pretty much like /dev/mem, but this is also working as intended.
For details see:
https://groups.google.com/g/syzkaller-bugs/c/1rVENJf9P4U/m/QtGpapRxAgAJ
https://syzkaller.appspot.com/bug?extid=f4f1e871965064ae689e
TODO: TIOCSSERIAL does some other things that are not dangerous
and would be nice to test, if/when we can sanitize based on sandbox value
we could prohibit it only under sandbox=none.
2019-12-19 19:32:45 +01:00
Dmitry Vyukov
79b211f74b sys/linux: fix caps test for new descriptions 2019-12-18 17:34:36 +01:00
Dmitry Vyukov
52395b6ee8 sys/test: add few other tests for tricky bitfields
Update #1542
2019-12-18 16:42:17 +01:00
Dmitry Vyukov
73c3845438 pkg/compiler: fix incorrect alignment calculation for padding
We assumed that for ConstType alignment is equal to size,
which is perfectly reasonable for normal int8/16/32/64/ptr.
However, padding is also represented by ConstType of arbitrary size,
so if we added 157 bytes of padding that becomes alignment of
the padding field and as the result of the whole struct.
This affects very few structs, but quite radically and quite
important structs.

Discovered thanks to syz-check.

Update #590
2019-12-18 14:44:12 +01:00
Dmitry Vyukov
42dc692776 sys/linux: another batch of syz-check fixes
Update #590
2019-12-18 14:38:24 +01:00
Dmitry Vyukov
fa33c32796 tools/syz-check: don't print our/kernel field name twice if equal 2019-12-18 12:04:56 +01:00
Dmitry Vyukov
82b3c9dfee sys/linux: fix few bugs
Fix some descirptions disperancies with kernel and regenerate warnings on next-20191218.
2019-12-18 12:00:12 +01:00
Dmitry Vyukov
1b49002e79 tools/syz-check: don't print line numbers for warnings
Line numbers create huge diffs when lines change slightly.
That's very unhandy b/c we want to look at added/removed warnings.
2019-12-18 10:50:24 +01:00
Dmitry Vyukov
2f68adff0b sys/linux: support new split sound ioctls
Some sounds ioctls are now explicitly doubled for 32/64 bits. Support that.
Fix mips SOL_SOCKET issues by rearranging includes.
Improve few other fields.
2019-12-18 10:50:24 +01:00
Dmitry Vyukov
0d635f1100 sys/syz-extract: print less output
Don't print every file if extraction is successful.
This makes seeing errors harder as output for each arch takes
more than a single screen.
2019-12-18 10:50:21 +01:00
Andrey Konovalov
f2fe0772a9 sys/linux: various descriptions fixes 2019-12-18 07:48:36 +01:00
Dmitry Vyukov
64ca0a3711 tools/syz-check: add description checking utility
syz-check parses vmlinux dwarf, extracts struct descriptions,
compares them with what we have (size, fields, alignment, etc)
and produces .warn files.
This is first raw version, it can be improved in a number of ways.
But it already helped to identify a critical issue #1542
and shows some wrong struct descriptions.

Update #590
2019-12-17 19:03:39 +01:00
Dmitry Vyukov
7b9de469e6 sys/linux: regenerate consts
Regenerate on next-20191217.
Rename s/VMADDR_CID_RESERVED/VMADDR_CID_LOCAL/ as it was renamed in kernel.
2019-12-17 11:21:45 +01:00
Dmitry Vyukov
17273b73d6 sys/syz-extract: don't redefine __asm__ in ELF mode
This is not necessary since we build legit object file
for the target binary now. But this breaks mips with:

/linux/arch/mips/include/asm/thread_info.h:53:30: error: register name not specified for ‘__current_thread_info’
 register struct thread_info *__current_thread_info __asm__("$28");

So just remove the old hack.

Follow up to #1536
2019-12-17 11:15:08 +01:00
Jouni Hogander
2b31345f36 Autogenerated files for linux/mips64le
This patch adds all autogenerated files for linux/mips64le. Files are
generated by following commands:

make extract
bin/syz-extract -build -os=linux -arch=mips64le -sourcedir=linux
make generate
2019-12-17 11:10:52 +01:00
Jouni Hogander
24856513b2 sys/syz-extract: Add mips64le specific include paths
Couple of include paths are needed for syz-extract to work for
mips64ler2.
2019-12-17 11:10:52 +01:00
Jouni Hogander
07bfd71dac Implement basic support for MIPS64LE
Add basic stuff to enable MIPS64ELR2 target:
 - build
 - make extract
 - make generate
 - qemu execution
 - system call parsing from /proc/kallsyms
2019-12-17 11:10:52 +01:00
Dmitry Vyukov
f5963ab6ed sys/linux: add a test that files are writable 2019-12-16 19:37:38 +01:00
Andrey Konovalov
0ae38e4489 sys/linux: minor improvements for USB descriptions
1. Define endpoint maxpacket as flags with a few valid values.

2. Define bits of bmNetworkCapabilities.
2019-12-16 09:28:02 +01:00
Dmitry Vyukov
a5c1ab05b3 sys/test: add more tests for bitfields
Add tests for issue #1542

The correct results are obtained with the following program:

struct foo {
	unsigned char	f0;
	unsigned int	f1:4;
	unsigned short	f2:4;
};

struct bar {
	char f0;
	struct foo foo;
};

int main() {
	struct bar y;
	memset(&y, 0, sizeof(y));
	y.f0 = 0x12;
	y.foo.f0 = 0x34;
	y.foo.f1 = 0x56;
	y.foo.f2 = 0x78;
	int i;
	for (i = 0; i < sizeof(y); i++)
		printf("%02x", ((unsigned char*)&y)[i]);
	printf("\n");
}
2019-12-13 15:26:10 +01:00
Dmitry Vyukov
cb704a294c executor: fix syz_mount_image
1. It always crashed in cover_reset when coverage is disabled.
2. Use NONFAILING when accessing image segments.
3. Give it additional 100 ms as it may be slow.
4. Add a test for syz_mount_image.
2019-12-10 16:08:35 +01:00
Andrey Konovalov
5a5826a14e sys/linux, dashboard: update USB config and IDs 2019-12-10 12:45:34 +01:00
Marco Vanotti
607350e438 syz/targets: add SyzExecutorCmd flag
This commit adds a new attribute to syzkaller targets that tells
syzkaller how to invoke the syz-executor command.

Some systems, like Fuchsia, are now building syz-executor as part of the
build, and there is no need to copy it over, or to run it from `/tmp`.
In fact, that might stop working at some time in the future in Fuchsia.

All places that used to copy syz-executor into the target machine will
now check for the SyzExecutorCmd flag, and won't copy it if the flag is
set.
2019-12-09 15:13:49 -08:00
Marco Vanotti
1f9a4e330b sys/targets: change clang++ to clang for fuchsia
Syzkaller binaries are built in C mode even if they are c++ binaries.
Recent clang version (clang++-10) consider this an error/warning,
causing issues during build time.

Change-Id: Ia6d1ab46597efc42772c1c7a63188c3c04a729a7
2019-12-09 15:13:49 -08:00
Marco Vanotti
701420fdad sys/targets: fix path for libdriver.so in Fuchsia 2019-12-09 15:13:49 -08:00
Dmitry Vyukov
1508f45368 sys/linux: refine few framebuffer/kbd ioctls 2019-12-07 18:45:45 +01:00
Andrey Konovalov
98b4ef2d37 sys/linux: update USB TODOs 2019-12-05 15:53:48 +01:00
Siddharth Muralee
9fd5a512f3 sys/netbsd: fix the build issues with posix_spawn 2019-12-05 10:06:13 +01:00
Siddharth M
b91ea9289b make required changes to sys/netbsd 2019-12-05 10:06:13 +01:00
R3x
a734d2a6d9 sys/netbsd: add the newer vfork syscall 2019-12-05 10:06:13 +01:00
R3x
e06d2ea701 sys/netbsd: Added posix_spawn and fork syscalls 2019-12-05 10:06:13 +01:00
Dmitry Vyukov
dfe2e9d84a sys/linux: enforce arguments of all syz_open_dev calls
Opening random devices can lead to havoc.
Enforce device major/minor.
2019-12-03 18:48:14 +01:00
Dmitry Vyukov
cbfd910250 sys/linux: more tuning of tty devices
Enable /dev/tty{1-6}. These seem to be special.
Few first connected to framebuffers. But the rest
seem to be different from e.g. tty20 anyway.
Also /dev/tty is different from the rest.
/dev/ttyS3 and /dev/ttyprintk are different.
Properly pair BSD pty terminals.
2019-12-03 18:48:14 +01:00
Dmitry Vyukov
a715d760ae sys/linux: add /dev/fb1
qemu -vga cirrus results in /dev/fb0 and /dev/fb1.
2019-12-03 18:48:14 +01:00
Dmitry Vyukov
ab342da3f9 sys/linux: add binderfs descriptions 2019-12-02 18:21:43 +01:00
Dmitry Vyukov
dc01aea003 sys/linux: add /dev/fb descriptions
Framebuffer descriptions + open more tty dev nodes.
2019-12-02 18:17:04 +01:00
Dmitry Vyukov
82d81ba98e sys/linux: regenerate consts
Regenerate consts now that make extract is fixed.
Interestingly some arm consts have changed (arm/i386 abi difference?).
2019-12-02 14:44:04 +01:00
Dmitry Vyukov
3aa380090f sys/syz-extract: extract constants from ELF
Add a second mode that extracts constant values from
ELF object, instead of running the executable.
This allows to not (1) link binaries, (2) use proper cross-compiler.
It finally fixes 386/arm extracts for my distro.
Hopefully not makes things worse for others,
should generally be safer/more reliable.
The current mode is left b/c I can't test all OSes,
windows binaries are not ELF, so we may need it anyway.
But later we may switch more OSes to this new mode
if they break (fuchsia?).
2019-12-02 14:36:47 +01:00
Dmitry Vyukov
f879db37f9 sys/linux: more device refinements
Add some mode /dev/nodes*
Add anoter midi device.
2019-12-01 19:51:52 +01:00
Dmitry Vyukov
5d12311f3a sys/linux: add /dev/ptp descriptions 2019-12-01 19:07:51 +01:00
Dmitry Vyukov
9dfc7e00d5 sys/linux: refine some device types
/dev/pmem0 is a block device.
/dev/adsp1 is the same as /dev/dsp1.
dmmidi,admmidi,amidi is the same as /dev/snd/midi.
2019-12-01 18:29:00 +01:00
Dmitry Vyukov
27d609bf84 sys/linux: add /dev/snd/pcm* descriptions 2019-12-01 17:47:28 +01:00
Dmitry Vyukov
c35a341c32 sys/linux: add /dev/dsp descriptions 2019-12-01 11:08:13 +01:00
Dmitry Vyukov
3504484430 sys/linux: update consts
Regenerate const files for all arches.
2019-12-01 11:03:27 +01:00
Dmitry Vyukov
edcd9e3c9a sys/syz-extract: use clang if gcc is broken
On my Debian gcc -m32 is hopelessly broken.
Using clang fixes at least arch 386.
Arch arm is still broken b/c clang does not like
some of kernel arm inline assemly constraints.
2019-12-01 10:59:54 +01:00
Dmitry Vyukov
a76bf83ffa sys/linux: fix /dev/watch_queue name
It's /dev/watch_queue not /dev/fd_watch_queue.
Don't know if it was renamed, or alwys wrong, but does not matter much,
now it's /dev/watch_queue.

Also attach v4l ioctls to /dev/swradio,radio,vbi,cec.
It seems that _some_ of them are applicable to these devices as well.
2019-11-30 19:17:15 +01:00
Dmitry Vyukov
3a75be00f5 sys/linux: add open of /dev/dri/renderD128
It's created by qemu but is not matched by the existing /dev/dri/renderD# pattern.
2019-11-29 15:03:37 +01:00
Dmitry Vyukov
ad6aec4193 sys/linux: fix NFC_SOCKPROTO_RAW socket call
It requires SOCK_SEQPACKET not SOCK_STREAM.
2019-11-29 14:47:56 +01:00
Dmitry Vyukov
4f7e1d0f5e sys/linux: use openat for /dev/cdrom
No need to use syz_open_dev here, openat will do.
Also add /dev/cdrom1 b/c qemu -machine q35 creates cdrom1 instead of cdrom.
2019-11-29 10:46:50 +01:00
Dmitry Vyukov
aac51b70cd sys/linux: use known tags for 9p virtio/xen
Name virtio/xen sources "syz" so that it's possible to expose
it from host and actually use.
2019-11-29 10:46:26 +01:00
Paul Chaignon
7a53a9d93f sys/linux: update BPF constants
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-11-29 10:45:42 +01:00
Shiyu Sun
d496d44718 sys/windows/sys.txt: use bool32 instead of int32[0:1] 2019-11-28 10:01:41 +01:00
Shiyu Sun
ba2dd280e6 sys/linux/socket.txt: add more description for socket ioctls 2019-11-28 10:01:41 +01:00
Shiyu Sun
2e2ab0c725 sys/linux: more update to current linux-next 2019-11-28 10:01:41 +01:00
Andrei Vagin
5a38f3f066 sys/linux: describe PTRACE_PEEKSIGINFO
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2019-11-27 09:35:58 +01:00
Christian Brauner
bc992c0ee4 sys/linux: add new arguments to struct clone_args for clone3()
Linux v5.5 extends struct clone_args for clone3() by two additional
parameters:

@set_tid:      Pointer to an array of type *pid_t. The size
               of the array is defined using @set_tid_size.
               This array is used to select PIDs/TIDs for
               newly created processes. The first element in
               this defines the PID in the most nested PID
               namespace. Each additional element in the array
               defines the PID in the parent PID namespace of
               the original PID namespace. If the array has
               less entries than the number of currently
               nested PID namespaces only the PIDs in the
               corresponding namespaces are set.
@set_tid_size: This defines the size of the array referenced
               in @set_tid. This cannot be larger than the
               kernel's limit of nested PID namespaces.

Cc: Adrian Reber <areber@redhat.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-11-26 13:07:43 +01:00
Eric Biggers
f72ffd024d sys/linux/fscrypt.txt: add FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64
This flag is new in 5.5.

Also add a link to the fscrypt API documentation.
2019-11-26 11:34:30 +01:00
Eric Biggers
f746151a93 sys/linux/init_alg.go: add new algorithms
Add new crypto algorithms from linux-next (future v5.5):

- BLAKE2b and BLAKE2s
- "-arm" implementations of ChaCha and XChaCha
- "-arm" and "-neon" implementations of Poly1305
2019-11-25 20:23:10 +01:00
Dmitry Vyukov
6bfd3dd23b sys/linux: update to current linux-next
Regenerate consts on linux-next next-20191125.
DEVLINK_ATTR_NETNS_* consts were chifted by 1.
__BPF_FUNC_MAX_ID increased as usual.
CRYPTO_ALG_TYPE_BLKCIPHER, CRYPTO_ALG_TYPE_ABLKCIPHER were removed,
replace them with CRYPTO_ALG_TYPE_SKCIPHER.
2019-11-25 14:30:28 +01:00
Dmitry Vyukov
0199dc9d8c sys/linux: add a NEED comment 2019-11-22 09:40:46 +01:00
Denis Efremov
e89749efe8 sys/linux: run "make generate" for smack
Signed-off-by: Denis Efremov <efremov@linux.com>
2019-11-22 09:14:41 +01:00
Denis Efremov
dd653133d5 sys/linux: extract constants for smack.txt
Signed-off-by: Denis Efremov <efremov@linux.com>
2019-11-22 09:14:41 +01:00
Denis Efremov
159175a74a sys/linux: update smack descriptions
Add descriptions for /sys/fs/smackfs/* interfaces.

Signed-off-by: Denis Efremov <efremov@linux.com>
2019-11-22 09:14:41 +01:00
Dmitry Vyukov
b5c36524a2 sys/targets: add HostFuzzer flag
Move HostFuzzer from vm/qemu.
It's needed in a number of other packages
and strictly saying is not specific to qemu
(it just happened that both fuchsia and akaros only support qemu).
2019-11-16 09:58:54 +01:00
David Pursell
79248ee88b sys/fuchsia: remove deprecated exception APIs
The port-based exception APIs have been deprecated on Fuchsia and will
be removed shortly. Delete them from the syscall definitions and
modify the Fuchsia executor to use the new channel-based APIs instead.
2019-11-14 16:21:01 -08:00
David Pursell
a3f5ce76b1 sys/fuchsia: fix Fuchsia extract/generate
Updates some paths and add zx_eventpair type definition to fix
`make extract` and `make generate`.
2019-11-14 16:21:01 -08:00
Jiri Pirko
5d15a96786 sys/linux/socket.txt: add devlink pci related netdev
Add netdev name related to pci netdev and fix comment for netdevsim0.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
2019-11-14 09:21:37 +01:00
Dmitry Vyukov
b17cbe9d11 sys/targets: don't run flag tests on non-build OS
We should not try to do any builds for such targets anyway.
And the compiler does not have to exist/work.
2019-11-07 11:06:56 +01:00
Dmitry Vyukov
0281aea335 sys/linux: fix up some int64 syscall args
See the discussion on #1493.
These args are actually intptr's.
2019-11-07 11:06:48 +01:00
Andrey Konovalov
bc2c6e45b9 sys/linux: update usb runtests
Add a test that issues multiple syz_usb_ep_write calls.
Update hiddev test to use a wider used hid driver.
2019-11-05 16:45:35 +01:00
Dmitry Vyukov
18e12644fc sys/linux/text: fix test program syntax 2019-11-04 12:46:09 +01:00
Dmitry Vyukov
e2d61622eb sys/linux: improve CAN descriptions 2019-11-04 12:39:39 +01:00
Dmitry Vyukov
99d946ccff executor: fix setup of vxcan
Adding vxcan1 also adds vxcan0. Setup and use both.
2019-11-03 15:00:15 +01:00
Jiri Pirko
d40d75d2d7 executor: move fixed pci devlink handle into network namespace
In case there is a fixed pci devlink handle "pci/pci/0000:00:10.0"
on the system (initial network namespace), it is moved to a working
network namespace.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
2019-11-03 14:20:59 +01:00
Jiri Pirko
97f4b019d8 sys/linux: extend devlink for fixed pci handle
Extend devlink to also work with fixed pci handle "pci/0000:00:10.0".

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
2019-11-03 14:20:59 +01:00
Jiri Pirko
fceca3f4b7 sys/linux: add forgotten SECCOMP_FILTER_FLAG_NEW_LISTENER bits
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
2019-11-03 14:20:59 +01:00
Dmitry Vyukov
d603afc9e4 sys/linux: add missing arm/386 CAN consts 2019-11-02 21:44:59 +01:00
Dmitry Vyukov
841212d4cc sys/linux: extend CAN descriptions 2019-11-02 21:31:45 +01:00
Paul Chaignon
1297f23947 sys/linux: use template base to simplify pppox description
Co-authored-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-11-02 21:30:47 +01:00
Paul Chaignon
997ccc675b pkg/compiler: define fileoff template
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-11-01 19:14:49 +01:00
Matthew Dempsky
a41ca8fa82 sys/targets: fix Fuchsia build
Zircon directories have changed. Again.
2019-10-30 13:28:29 -07:00
Dmitry Vyukov
439d7b14af sys/linux: add SECCOMP_FILTER_FLAG_NEW_LISTENER support 2019-10-28 16:54:23 +01:00
Paul Chaignon
cddfeb2030 sys/linux: fix range in InfiniBand description
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-10-25 18:16:59 +02:00
Paul Chaignon
f2635abc2a sys/linux: use alignment in integer ranges
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-10-25 18:16:59 +02:00
Paul Chaignon
9113054e42 sys/freebsd: fix int should be const
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-10-25 18:16:59 +02:00
Paul Chaignon
618d98cd48 sys/linux: fix int should be const in InfiniBand description 2019-10-25 18:16:59 +02:00
Dmitry Vyukov
c401a48c99 sys/linux: add ioctl_ns 2019-10-25 13:41:12 +02:00
Jiri Pirko
04ca72cd45 sys/linux: add support for basic devlink syscalls
Add support for basic set of devlink interface syscalls

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
2019-10-25 13:15:56 +02:00
Hangbin Liu
d01bb02a96 sys/linux/socket_netlink_route_sched: update tca_polices
Update #533

This patch update tca_polices by adding new polices TCA_POLICE_RATE64
and TCA_POLICE_PEAKRATE64

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2019-10-24 09:30:50 +02:00
Hangbin Liu
c29eac91f1 sys/linux/socket_netlink_route_sched: add new tc actions
Update #533

This patch add new tc actions: ct, ctinfo, xt, mpls

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2019-10-24 09:30:50 +02:00
Hangbin Liu
4807c9ef9f sys/linux/socket_netlink_route_sched: add tc flower filter
Update #533

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2019-10-24 09:30:50 +02:00
Hangbin Liu
cf14803361 sys/linux/socket_netlink_route_sched: add some new classes
Update #533

In this patch I added new classes: cake, cbs, fq_codel, mq, mqprio,
multiq, netem, prio, red, sfb, sfq, skbprio, taprio, tbf, ingress,
clsact.

These classes has Qdisc_class_ops in kernel, but no netlink parameters.
So we can testing them by just calling them directly.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2019-10-24 09:30:50 +02:00
Hangbin Liu
40b82bef55 sys/linux/socket_netlink_route_sched: add some new qdiscs
Update #533

In this patch I added new qdiscs cake, etf, pfifo_fast, plug,
qfq, rr, skbprio, taprio, atm, drr, blackhole, clsact, ingress,
mq.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2019-10-24 09:30:50 +02:00
Hangbin Liu
b1f951e1e4 sys/linux/socket_netlink_route_sched: fix tcm_info structure
Update #533

Don't know why I didn't add tcm__pad in tcm_info structure
at the begining. But let's fix it now.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2019-10-24 09:30:50 +02:00
Hangbin Liu
910e03ca15 sys/linux/socket_netlink_route_sched: add chain actions
Update #533

Chain actions also use filter policies, so we can add them easily.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2019-10-24 09:30:50 +02:00
Andrey Konovalov
a970258ea5 dashboard/config: better extract usb configs
When generating a USB config, disable USB symbols that are disabled in the
base config, as they might have been enabled when some of the dependecies
got enabled.
2019-10-23 10:13:19 +02:00
Andrey Konovalov
6901a56e00 executor/usb: enable endpoints on SET_INTERFACE
This commit changes syz_usb_control_io to enable the relevant endpoints
for the interface being set via a SET_INTERFACE request.
2019-10-21 15:56:03 +02:00
Andrey Konovalov
8c88c9c1c9 sys/linux/vusb.txt: add some TODOs 2019-10-16 18:28:52 +02:00
Dmitry Vyukov
d4ea592f78 sys/linux: add some new flags
Add a few new assorted things, some flags, etc.
2019-10-15 14:13:41 +02:00
Dmitry Vyukov
2b7a4c5e69 sys/linux: add exfat descriptions 2019-10-15 13:50:06 +02:00
Dmitry Vyukov
6078bcf4f9 sys/linux: add watch_queue descriptions 2019-10-15 13:50:06 +02:00
Andrey Konovalov
323ca50263 sys/linux/vusb.txt: describe UAC1 device class 2019-10-15 13:08:30 +02:00
Andrey Konovalov
05ad729222 dashboard/config: update USB config 2019-10-14 14:14:06 +02:00
Veronica Radu
1a3bad9041 prog: mutate length of output buffers
Update #480
2019-10-10 14:37:42 +02:00
Andrew Donnellan
d52eff2843 sys/targets: Disable PIE/ASLR when building tests
Due to issues with ASLR + ASan on ppc64le (see #1446), add the -no-pie
flag to the test target so tests will pass.

Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
2019-10-10 10:21:51 +02:00
Eric Biggers
312c6a5a73 sys/linux/init_alg.go: add new algorithms
- Add essiv (new in v5.4)
- Add xxhash64 (new in v5.3)
2019-10-09 09:06:58 +02:00
Dmitry Vyukov
2ab6c4a457 sys/linux: improve i2c descriptions a bit 2019-10-08 16:06:26 +02:00
Andrey Konovalov
b7a87a83f8 dashboard, sys/linux: update USB configs 2019-10-01 14:00:17 +02:00
Veronica Radu
9d33246a91 sys/linux: add new syscall descriptions for devio and usbmon
Update #533
2019-10-01 13:55:20 +02:00
Eric Biggers
c7a4fb9986 sys/linux/dev_binder.txt: also support real-world binder device names
It was reported that binder isn't covered when using syzkaller on a real
Android device, since the binder device names are different.  Update the
descriptions to know about the real-world device names too.
2019-09-30 12:36:26 +02:00
Dmitry Vyukov
d8074e0bb9 sys/linux: add new pidfd syscalls 2019-09-27 13:35:42 +02:00
Andrey Konovalov
38634e3316 sys/linux: add more USB runtests 2019-09-24 16:42:10 +02:00
Andrey Konovalov
c9f1048063 sys/linux: add USB hiddev runtest 2019-09-24 10:45:51 +02:00
Paul Chaignon
a32a318486 sys/linux: update BPF constants
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-09-19 15:31:20 +02:00
Eric Biggers
eb9400440d sys/linux: re-generate Linux descriptions from next-20190918 2019-09-19 09:38:51 +02:00
Eric Biggers
a4e87d4bb6 sys/linux: update fscrypt descriptions
- For v5.4: new ioctls FS_IOC_ADD_ENCRYPTION_KEY,
  FS_IOC_REMOVE_ENCRYPTION_KEY, FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS,
  FS_IOC_GET_ENCRYPTION_KEY_STATUS, and FS_IOC_GET_ENCRYPTION_POLICY_EX.

- For v5.4: FS_IOC_SET_ENCRYPTION_POLICY now accepts an
  fscrypt_policy_v2 argument in addition to the original fscrypt_policy
  which is now called fscrypt_policy_v1.

- For v5.4: the fscrypt definitions were moved to a new header
  <linux/fscrypt.h>, and some constants were given new FSCRYPT_* names
  instead of FS_*.  Handle this, and to keep things organized similarly
  move the syzkaller descriptions to a new file fscrypt.txt.

- For v5.0: remove the removed Speck modes and add Adiantum.

- For v5.0: add the DIRECT_KEY encryption policy flag.

Also fix the argument types for FS_IOC_GET_ENCRYPTION_POLICY and
FS_IOC_GET_ENCRYPTION_PWSALT, which had been mixed up.
2019-09-19 09:38:51 +02:00
Eric Biggers
6aa8d1eb8f sys/syz-extract: re-enable extraction for fsverity.txt
fsverity is now upstream, so re-enable extracting its consts.
2019-09-19 09:38:51 +02:00
Andrey Konovalov
14d4158490 sys/targets: add ASAN compiler flag to optional
*BSD GCC doesn't have ASAN.
2019-09-18 14:02:33 +02:00
Paul Chaignon
c2dcd7009f sys/linux: update BPF's anonymous structures
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-09-18 06:50:02 +02:00
Paul Chaignon
03e0d24559 sys/linux: basic support for bpf-to-bpf function calls
The BPF template currently only defines helper calls.  BPF function calls
(bpf-to-bpf calls) are however supported in Linux since v4.16.

This patch defines bpf-to-bpf calls in the template.

Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-09-17 20:38:59 +02:00
Andrey Konovalov
e9b387d18c sys/targets: build executor with ASAN for test target 2019-09-17 15:10:25 +02:00
Paul Chaignon
c9364a4648 sys/linux: support for loopkup-free map value accesses
A new BPF instruction that allows lookup-free map value accesses was added
in Linux v5.2, with commit d8eca5b ("bpf: implement lookup-free direct
value access for maps").  It enables direct access to map values without
having to call a BPF helper.  It is currently used to implement global
variable support.

This commit adds support for that new instruction.

Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-09-17 14:41:41 +02:00
Michael Tuexen
cb93629971 sys/freebsd/sys.txt: update sendfile description
The signature of sendfile() on FreeBSD is different from the one
used on Linux.
2019-09-16 10:39:16 +02:00
Michael Tüxen
55c50e708b
sys/freebsd/vnet.txt: replace IPPROTO_SEP by IPPROTO_DCCP (#1401)
r350749 updated the constant from IPPROTO_SEP to IPPROTO_DCCP
to be consistent with the IANA registry.
2019-09-16 09:51:17 +02:00
Andrey Konovalov
a381ceb297 sys/linux/usb: fix CDC mac address encoding 2019-09-06 20:11:54 +02:00
Andrey Konovalov
35d270e58c sys/linux/usb: always provide device string ids
This forces the kernel to make a USB string request and select a lang ID
early during the enumaration stage.
2019-09-06 20:11:54 +02:00
Andrey Konovalov
4280382fb9 sys/linux/vusb.txt: properly describe interfaces for USB CDC NCM
Also rename cdc_ethernet to cdc_ecm.
2019-09-06 17:19:55 +02:00
Andrey Konovalov
a38da1b89a sys/linux, executor: basic support for multiple USB interfaces 2019-09-06 17:19:55 +02:00
Andrey Konovalov
bf6bcce4f2 sys/linux/vusb.txt: fix typo in descriptions 2019-09-05 16:28:13 +02:00
Andrey Konovalov
d994512dff sys/linux, dashboard: update USB config 2019-09-04 13:09:49 +02:00
Veronica Radu
5de425bc59 prog: implemented argument and call priorities 2019-09-04 10:46:46 +02:00
Andrey Konovalov
12381952e3 sys/linux/vusb.txt: fix unused EPSNUM param 2019-09-04 07:10:15 +02:00
Andrey Konovalov
78ded1969a
sys/linux, executor: minor USB fixes (#1361) 2019-08-23 14:50:37 +02:00
Andrey Konovalov
ca6f3cfa78
sys/linux: fix bNumEndpoints in a USB interface (#1360)
bNumEndpoints is defined as len[endpoints]. This initially assumed that
endpoints is an array, which is not the case for descriptions for
particular USB classes. Improve it by defining a new template for interfaces
and passing in a value range for bNumEndpoints for these cases.
2019-08-22 19:53:52 +02:00
Matthew Dempsky
cfc9868f25 sys/targets: fix Fuchsia builds
https://fuchsia-review.googlesource.com/c/fuchsia/+/310006 added new
dependencies to the Fuchsia DDK, which in turn introduced new include
directories that syzkaller needs to specify when building executor.
2019-08-19 15:02:45 -07:00
Marco Vanotti
55bf892687 sys/targets: Change CCompiler path for fuchsia.
Recently fuchsia got rid of the buildtools/ folder, and moved some of
the stuff into the prebuilt directory.

See https://fuchsia-review.googlesource.com/c/fuchsia/+/305379 for more
info.
2019-08-17 06:58:15 -07:00
Andrey Konovalov
0d298d6b2e
sys/linux: add basic USB CDC NCM descriptions (#1337)
CDC NCM support is incomplete, as it requires support for describing multiples
interfaces per configuration.
2019-08-14 21:05:27 +02:00
Andrey Konovalov
27bd5400c8
sys/linux: fix USB string descriptors (#1336)
They should either contain a lang id or a string.

Do some other minor fixes as well.
2019-08-14 18:25:24 +02:00
Marco Vanotti
770d4e1bc7 sys/fuchsia: update socket syscalls 2019-08-14 09:34:25 +02:00
Anton Lindqvist
8620c2c258 sys/openbsd: add ktrace description 2019-08-12 11:16:16 +02:00
Anton Lindqvist
e44fc68a53 sys/openbsd: add acct description 2019-08-12 11:16:16 +02:00
Anton Lindqvist
62d3ec4876 sys/openbsd: add speaker descriptions 2019-08-12 11:16:16 +02:00
Andrey Konovalov
acb5163814
sys/linux: add basic USB CDC Ethernet descriptions (#1328) 2019-08-09 19:46:27 +02:00
Dmitry Vyukov
1ecb069f0e sys/targets: fix build on darwin
Currently build on darwin crashes when we try to access host.CCompiler/CPP
(there is no darwin target). Check that we have the host target before using it,
otherwise use default gcc/cpp.
2019-08-09 18:05:51 +02:00
Veronica Radu
aff9e255cd prog: add special mutation for binary flags 2019-08-09 15:02:02 +02:00
Andrey Konovalov
d545e945ce sys/linux: add syz_open_dev$char_usb descriptions
syz_open_dev$char_usb opens char devices with major = USB_MAJOR.
Sanitize its values to make sure it doesn't open other char/block devices.
2019-08-08 15:34:27 +02:00
Andrey Konovalov
cdde748628
sys/linux: add basic USB PRINTER descriptions (#1316)
Also put USB HID descriptions together.
2019-08-06 18:26:57 +02:00
Andrey Konovalov
bac5ccb8fb
sys/linux: import HID report descriptor descriptions (#1311)
Remove long items and better specify tags.
2019-08-02 19:17:30 +02:00
Andrey Konovalov
3faab80738
dashboard, sys/linux: extract more HID USB configs (#1310)
Some USB drivers don't depend on core USB symbols, but rather depend on a
generic symbol for some input subsystem (e.g. HID). Account for that when
extracting USB configs.
2019-08-02 18:26:44 +02:00
Hangbin Liu
f28bf2a5db sys/linux/socket.txt: update timestamp options
Update socket timeval, timestamp options and flags.

v2: separate SO_{TIMESTAMP, TIMESTAMPNS}_{OLD, NEW} as they only need
enable/disable option value.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2019-07-30 09:28:49 +02:00
Dmitry Vyukov
cf49ed5769 prog: don't minimize ProcType to 0
Default value for ProcType is 0 (same for all PID's).
Usually 0 either does not make sense at all or make different PIDs collide
(since we use ProcType to separate value ranges for different PIDs).
So don't change ProcType to 0 unless the type is explicitly marked as opt
(in that case we will also generate 0 anyway).
2019-07-26 10:29:36 +02:00
VeronicaRadu
091bb0070f sys/linux: add usbmon add vfio descriptions 2019-07-26 09:07:19 +02:00
Andrey Konovalov
32329ceb4b sys/linux: fix USB runtest 2019-07-24 10:38:36 +02:00
Andrey Konovalov
55e0c07757
sys/linux: extract USB HID ids (#1294)
* sys/linux: extract USB HID ids

As it turns out the HID kernel subsystem registers only one USB driver that
checks that the interface of the connected device has HID class and then looks
up its own list of vendor/device ids to find a matching driver. This means
that we currently don't generate proper vendor/device ids for USB HID devices.

This patch updates the syz-usbgen tool to also extract USB HID vendor/device
ids from a running kernel and makes the generated descriptions for HID devices
to be patched using the extracted ids.

This patch also contains some minor improvements to USB descriptions
(better HID descriptions and more replies for some USB classes/drivers).

* sys/linux: run make generate
2019-07-22 19:25:54 +02:00
Dmitry Vyukov
6a786da97c sys/linux: use AT_FDCWD only for directories
Currently we use AT_FDCWD as a special value for all file descriptors,
but it does not make sense for almost all of them (sockets, bpf, etc).
Use it as a special value only for fd_dir.
2019-07-22 13:05:39 +02:00
Dmitry Vyukov
f3ad684464 executor: drop CAP_SYS_NICE
A process with CAP_SYS_NICE can bring kernel down by asking for too high SCHED_DEADLINE priority,
as the result rcu and other system services that use kernel threads will stop functioning.
Some parameters for SCHED_DEADLINE should be OK, but we don't have means to enforce
values of indirect syscall arguments. Peter Zijlstra proposed sysctl_deadline_period_{min,max}
which could be used to enfore safe limits without droppping CAP_SYS_NICE, but we don't have it yet.
See the following bug for details:
https://groups.google.com/forum/#!topic/syzkaller-bugs/G6Wl_PKPIWI
2019-07-22 11:59:00 +02:00
Dmitry Vyukov
be348f6db3 sys/linux: improve sched_attr description
Today we have means to properly describe parent size.
2019-07-22 11:51:58 +02:00
Dmitry Vyukov
5181b54d45 executor: drop CAP_SYS_PTRACE with sandbox=none
We only drop CAP_SYS_PTRACE for sandbox=namespace,
but it can equally affect testing with sandbox=none.
Drop it for sandbox=none, add a test.
2019-07-22 11:51:53 +02:00
Dmitry Vyukov
e530ec1bef pkg/csource: test sys/*/test programs
Running sys/*/test programs requires real machines and kernels for each OS.
We can't do that in unit tests, but at least try to deserialize these programs
so that they don't get rotten.
2019-07-22 10:20:51 +02:00
Anton Lindqvist
919efc620a sys/openbsd: prevent swap partition device nodes from being created
Writing to the swap partition during fuzzing can lead to all kinds of
corruptions[1].

[1] https://syzkaller.appspot.com/bug?id=a2eca15e6e0be4be3ed1b0b2bab3332edc317b1c
2019-07-22 07:36:41 +02:00
Marco Vanotti
0d10349cf0
sys/fuchsia: update zx_clock_get syscall (#1292)
* sys/fuchsia: update zx_clock_get.

zx_clock_get was deprecated and replaced by zx_clock_get_new. In a
recent CL[0], they replaced the zx_clock_get by zx_clock_get_new and
moved all client. This commit updates syzkaller to use the new function.

[0]: https://fuchsia-review.googlesource.com/c/fuchsia/+/298575

* run make extract && make generate
2019-07-16 17:09:43 -07:00
Dmitry Vyukov
96b8132aaf sys/syz-extract: fix too long line 2019-07-16 16:34:29 +02:00
Marco Vanotti
d6d32e566b run make extract and make generate for fuchsia 2019-07-16 16:34:29 +02:00
Marco Vanotti
d862d22d79 sys/fuchsia: remove RESIZEABLE flags from vmo ops.
This change removes the ZX_VMO_NON_RESIZABLE flag for vmo create and the
ZX_VMO_CHILD_NON_RESIZEABLE flag from vmo create child.

The flags were removed upstream in cl:
https://fuchsia-review.googlesource.com/c/fuchsia/+/293991
2019-07-16 16:34:29 +02:00
Marco Vanotti
6aad7497a8 sys/syz-extract: Add "DefineGlibcUse" flag.
Instead of defining the __GLIBC_USE macro on every OS, we are just
defining it based on a parameter. That parameter is set to false for all
OSs except for fuchsia.
2019-07-16 16:34:29 +02:00
Marco Vanotti
75b7c614dd sys/fuchsia: rename vmo_clone to vmo_create_child.
This commit modifies the vmo_clone definition, renaming it to
vmo_create_child. This change happened in fuchsia a few weeks ago[0].

[0]: https://fuchsia-review.googlesource.com/c/fuchsia/+/272268/
2019-07-16 16:34:29 +02:00
Marco Vanotti
1472562444 sys/syz-extract: define __GLIBC_USE if not defined.
When I try to run `make extract` for fuchsia, the clang compiler
complains that __GLIBC_USE is undefined.

This CL just defines it to be an always false function-like macro if it
was not defined.
2019-07-16 16:34:29 +02:00
Marco Vanotti
de59bed3f8 sys/fuchsia: update paths for fdio and driver libs.
This commit updates the targets for fuchsia, modifying the clang flags
so that it uses the correct path to link against libfdio and libdriver.
2019-07-16 16:34:29 +02:00
Marco Vanotti
48bc210db4 sys/fuchsia: remove power fidl definitions.
This commit removes the fuchsia-power fidl definitions. The interface
doesn't have a service implementing it in fuchsia, and it is causing
issues in make extract.
2019-07-16 16:34:29 +02:00
Andrey Konovalov
e2b11c0ada dashboard: fix usb config extraction script
Fix extracting more configs that are actually enabled.
Regenerate upsteam-usb.config and sys/linux/init_vusb_ids.go.
2019-07-16 15:02:36 +02:00
Andrey Konovalov
6bc0be8b21
sys/linux, executor: improve USB descriptions
1. Change HID descriptions to allow devices to have two interrupt endpoints.
2. Remove unneeded responses to OUT control requests from descriptions.
3. Add some debugging code to detect and report missing descriptions.
2019-07-16 13:07:56 +02:00
Eric Biggers
f27c4411ef sys/linux: update fs-verity descriptions
The fs-verity API was redesigned, and we're planning to re-add the
fs-verity patches to linux-next soon.  Get the syzkaller descriptions up
to date with the new API [1]

[1] https://lkml.kernel.org/linux-fsdevel/20190701153237.1777-4-ebiggers@kernel.org
2019-07-16 12:10:18 +02:00
Paul Chaignon
36835e4e11 sys/linux: update BPF constants
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-07-16 11:38:43 +02:00
Eric Biggers
84d08cdf2d sys/linux: update for v5.3 again
Update descriptions to be compatible with latest linux-next
(next-20190715), which in theory will match v5.3-rc1 when the merge
window closes.

- KEYCTL_GRANT_PERMISSION was reverted.  So remove its description.

- CRYPTO_ALG_TYPE_DIGEST was removed.  So remove its description.

- IB_QP_CREATE_SIGNATURE_EN was renamed to IB_QP_CREATE_INTEGRITY_EN.

Also remove the sys/linux/rdma_*.const files which were incorrectly
checked into git.  The real copies of those files are in
sys/linux/dev_infiniband_rdma_*.const.

For now I did *not* check for other new APIs that need to be described.
2019-07-16 10:08:43 +02:00
Eric Biggers
139ac68a73 sys/linux: update key descriptions
- Add KEYCTL_MOVE (new in v5.3)
- Add KEYCTL_CAPABILITIES (new in v5.3)
- Add KEYCTL_GRANT_PERMISSION (new in v5.3)
- Remove KEY_PERM_UNDEF (was only ever in an internal kernel header,
  not in UAPI; removed in v5.3)
2019-07-15 13:44:02 +03:00
Siddharth M
2bbe2f0558 executor: add network packet injection for NetBSD
* Initial Commit

* working build of network packet fuzzing

* Add missed csource file

* pkg/csource: fix build

* executor/common_bsd.h: Add comment stating reason for ifconfig create
2019-07-14 17:59:29 +03:00
Anton Lindqvist
ff7bf04c7c sys/openbsd: add diskmap descriptions 2019-07-10 22:37:39 +02:00
Denis Efremov
a0626693a0 sys/linux: fix floppy description
* sys/linux: fix floppy description

Fix typo in the FDGETPRM ioctl.

* sys/linux: extract && generate for floppy

Signed-off-by: Denis Efremov <efremov@linux.com>
2019-07-05 09:16:10 +02:00
Andrey Konovalov
cccc4302d7 sys/linux, executor: run make extract and generate 2019-07-01 17:26:35 +02:00
Andrey Konovalov
13c3a99962 sys/linux, executor: add syz_usb_ep_read syzkall
syz_usb_ep_read reads data from USB endpoints other than #0.
2019-07-01 17:26:35 +02:00
Siddharth M
907bf74686 sys/netbsd: Adding more syscalls
* sys/netbsd: Adding more syscalls

* Added lwp create structures

* Added a few lwp flags

* completed _lwp* syscalls

* add clone syscall

* fix errors, recheck arguments
2019-07-01 12:37:45 +02:00
Anton Lindqvist
699d6448c8 sys/openbsd: add missing WSDISPLAYIO_SBURNER ioctl command 2019-06-30 20:34:23 +02:00
Hangbin Liu
c2c0d4d6ae sys/linux: update mpls_lable and rta types
Kernel get mpls lable like
```
unsigned entry = be32_to_cpu(hdr->label_stack_entry);
result.label = (entry & MPLS_LS_LABEL_MASK) >> MPLS_LS_LABEL_SHIFT;
```
So we just need to store the label in big endian order.

For mpls rta types, kernel accpet only one lable for RTA_DST and
multi labels for RTA_NEWDST.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2019-06-26 16:34:37 +02:00
R3x
c0d1d69763 sys/netbsd: Add new syscalls exit and ptrace 2019-06-26 11:18:16 +02:00
Andrey Konovalov
82c13b6b49 sys/linux, executor: run make extract and generate 2019-06-24 17:24:44 +02:00
Andrey Konovalov
fa26c3cf35 sys/linux, executor: add basic USB HID fuzzing support
This commit adds the necessary descriptions and executor adjustments to
enable targeted fuzzing of the enumeration process of USB HID devices.
2019-06-24 17:24:44 +02:00
Paul Chaignon
3efccdd201 sys/linux: update BPF constants
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-06-23 13:17:12 +02:00
Michael Tuexen
b39edb92c6 sys/freebsd: fix sockaddr structures
FreeBSD uses in sockaddr_{in,in6,un} structures a length field.
2019-06-23 13:16:30 +02:00
Anton Lindqvist
efb619c0e4 sys/openbsd: correct setrlimit resource detection
The sanitizer fails to sanitize programs like the following:

  setrlimit(0x10000000000002, &(0x7f0000000080))

... due to presence of the most significant bit. Therefore mask of all
bits that cannot form a valid rlimit resource.

This is one of the root causes of the high amount of reported "lost
connection to test machine".
2019-06-18 16:28:55 +02:00
Anton Lindqvist
442206d76b sys/openbsd: sanitize mlockall syscalls
Locking down future mappings will most likely cause syz-executor to run
out of memory.

This is one of the root causes of the high amount of reported "lost
connection to test machine".
2019-06-14 18:34:50 +02:00
Anton Lindqvist
998ccc760b sys/openbsd: rename test case 2019-06-13 18:51:26 +02:00
Anton Lindqvist
dad7ee745f sys/openbsd: sanitize setrlimit(RLIMIT_STACK) syscalls
Do not allow the stack to grow beyond the initial soft limit chosen by
syz-executor. Otherwise, syz-executor will most likely not be able to
perform any more heap allocations since they majoriy of memory is
reserved for the stack.

This is one of the root causes of the high amount of reported "lost
connection to test machine".
2019-06-13 18:51:26 +02:00
Andrey Konovalov
5a3f55c869 sys/linux: run make extract and generate
Forgot to do it after the last changes in hiddev descriptions.
Fuse is also updated.
2019-06-12 15:26:04 +02:00
Anton Lindqvist
794a1ad73a sys/openbsd: sanitize setrlimit(RLIMIT_DATA) syscalls (#1231)
OpenBSD performs a strict validation of the RLIMIT_DATA soft limit
during memory allocation. Lowering the same limit could cause
syz-executor to run out of memory quickly. Therefore make sure to not go
lower than the default soft limit for the staff group.

This is one of the root causes of the high amount of reported "lost
connection to test machine".
2019-06-11 16:50:14 -07:00
Anton Lindqvist
0159583c3b sys/openbsd: prevent using vio0 as a virtual multicast interface
One of the root causes to reported "lost connection to test machine" is
when the egress network interface is being used as a multicast
interface:

  setsockopt$inet6_MRT6_ADD_MIF(r0, 0x29, 0x66, &(0x7f0000000180)={0x2}, 0xc)

Prevent such syscalls from being generated by limiting the range of
allowed interface indices.
2019-06-08 10:13:59 +02:00
Andrey Konovalov
58c4b1aeab sys/linux: use template based structure for USB descriptions
To allow future extensions of USB descriptions to fuzz particular USB
classes this patch changes the structure of USB descriptions to use
templates.

This will invalidate all existing USB corpus.
2019-06-07 15:37:00 +02:00
Andrey Konovalov
b004e95a3a sys/linux: add hidraw and hiddev descriptions 2019-06-07 11:52:50 +02:00
Andrey Konovalov
698773cb4f sys/linux: don't inherit fd_usb from fd
This is a special fd, we don't want various ioctls be called on it.
2019-06-06 16:24:27 +02:00
Anton Lindqvist
73a7d55bdf sys/openbsd: add klog descriptions 2019-06-05 19:18:58 -07:00
Anton Lindqvist
6354390a82 sys/openbsd: add missing wsmouse ioctl descriptions 2019-06-05 19:18:58 -07:00
Bins94
816587a771 sys/linux: update descriptions of sendmsg/sendmmsg
Add sendmsg$inet, sendmmsg$inet for ip_cmsg_send.
Add sendmsg$inet6, sendmmsg$inet6 for ip6_datagram_send_ctl
2019-06-03 18:43:52 +02:00
Paul Chaignon
53c81ea538 sys/linux: add missing BPF constants
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-05-31 17:31:58 +02:00
Andrey Konovalov
142ce68175 pkg/runtest: add simple USB runtest 2019-05-31 13:35:25 +02:00
Andrey Konovalov
a8482b78fb sys/linux/vusb.txt: more descriptions to be done 2019-05-31 13:24:54 +02:00
Paul Chaignon
d9aaf3c288 sys/linux: add missing BPF constants
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-05-29 16:17:05 +02:00
Andrey Konovalov
c87d57e3e0 dashboard: update USB configs to the latest usb-linus
Also clean up config generation scripts a bit.
2019-05-29 15:56:43 +02:00
Dmitry Vyukov
2c7afa511c sys/targets: fix freebsd/386 executor build on some hosts
Add -B/usr/lib32 to 386 build flags.
The story behind -B/usr/lib32 is not completely clear, but it helps in some cases.
For context see discussion in https://github.com/google/syzkaller/pull/1202
2019-05-29 15:44:25 +02:00
Andrew Turner
5457ef3463 sys/freebsd: Add support for fuzzing FreeBSD/i386
Add support to fuzz 32 bit FreeBSD system calls.
2019-05-29 14:28:59 +02:00
Anton Lindqvist
85c573157d pkg/csource: add ability to annotate syscalls using comments in C reproducers
Providing additional info, especially regarding syscall arguments, in reproducers
can be helpful. An example is device numbers passed to mknod(2).

This commit introduces an optional annotate function on a per target basis.

Example for the OpenBSD target:

  $ cat prog.in
  mknod(0x0, 0x0, 0x4503)
  getpid()
  $ syz-prog2c -prog prog.in
  int main(void)
  {
    syscall(SYS_mmap, 0x20000000, 0x1000000, 3, 0x1012, -1, 0, 0);
    syscall(SYS_mknod, 0, 0, 0x4503); /* major = 69, minor = 3 */
    syscall(SYS_getpid);
    return 0;
  }
2019-05-24 22:33:56 +02:00
Pascal Perez
0625bb5c4c sys/fuchsia: Updating Fuchsia definitions
Simply

	make extract TARGETOS=fuchsia SOURCEDIR=<FUCHSIA_DIR>/fuchsia
2019-05-21 14:55:36 -07:00
Pascal Perez
77beeccbe0 sys: Updating Fuchsia extraction scripts
Consolidating FIDL library build mappings in one place, so that it can
be used from extraction, and script invoking fidlgen. This also makes
code clearer, and provides a more natural path for evolutions / dealing
with oddities.

Minor doc update post fx command changes.
2019-05-21 14:55:36 -07:00
Dmitry Vyukov
95dfd515a0 sys/linux: improve binder descriptions
Refine some consts to increase changes of correct programs.
Fix some types. Add comments and a test.
2019-05-17 11:56:54 +02:00
Dmitry Vyukov
7fb690f39a sys/linux: improve binder descriptions
Always pass 3 objects in a transaction.
This allows to specify correct offsets for objects.
Let's see if this improves coverage.
2019-05-16 19:19:25 +02:00
Dmitry Vyukov
b1165d81a4 sys/linux: use offsetof in ebtables
Resolve 2 TODOs in ebtables using the new offsetof type.
2019-05-16 18:26:31 +02:00
Dmitry Vyukov
76fc461b55 pkg/compiler: add offsetof type
Similar to C offsetof gives offset of a field
from the beginning of the parent struct.
We have several TODOs in descriptions asking for this.
2019-05-16 18:05:05 +02:00
Dmitry Vyukov
491919b14f pkg/compiler: work around 0-array-size errors due to missing consts
A const can be used as array size. Then if the const is not present
on all arches, compiler will produce an error about 0-sized-array.
There is no easy way to work around this for a user.
Use value of 1 for missing consts. It's just a bit safer.
2019-05-15 13:48:59 +02:00
Dmitry Vyukov
01d1494471 .golangci.yml: add codeanalysis build tag
Using a build tag to exclude files for golangci-lint
reduces memory consumption (it does not parse them).
The naive attempt with skip-dirs did not work.
So add codeanalysis build tag and use it in auto-generated files.

Update #977
2019-05-15 11:39:31 +02:00
Dmitry Vyukov
2e6300854a sys/linux: improve binder descriptions
Add few new ioctl's. Add some typedefs for clarity.
2019-05-14 19:28:01 +02:00
Dmitry Vyukov
c1caccc833 sys/linux: improve key and net_sch descriptions
Use the len paths to resolve pending TODOs.
2019-05-14 19:28:01 +02:00
Dmitry Vyukov
2376f0f937 pkg/compiler: allow to refer to syscall arguments in len paths
This allows to use len[syscall:arg] expressions.
2019-05-14 19:28:01 +02:00
Dmitry Vyukov
30e50d7959 sys/akaros: rename syscall argument
In preparation for making syscall a reserved name.
2019-05-14 19:28:01 +02:00
Dmitry Vyukov
cd3454ba97 sys/linux: improve btf descriptions
Now that we have the len path expressions we can fix the TODO
in btf descriptions to properly specify offsets of btf sections.

Also add proper descriptions for btf type section
and few other minor things around.
2019-05-14 19:28:01 +02:00
Dmitry Vyukov
93dcf0adc8 prog: implement complex len target support
This actually implements support for complex len targets
during program generation and mutation.
2019-05-14 19:28:01 +02:00
Dmitry Vyukov
16c881ad85 pkg/compiler: generate complex len targets
Change the generated format for len type to support multiple path elements.
2019-05-14 19:28:01 +02:00
Dmitry Vyukov
354b388e08 sys/test: remove a leftover file 2019-05-14 19:28:01 +02:00
Anton Lindqvist
ada3c44cd1 sys/openbsd: prevent changing mutability flags on files (#1174)
This is especially problematic for file descriptors referring to tty/pty
devices since it can cause the SSH connection to the VM to die.

The ambition here is reduce the number of "lost connection/no output" failures
at the cost of limiting the coverage of chflags(2).
2019-05-13 18:14:26 -07:00
Andrey Konovalov
7c305b440c dashboard: add scripts for generating USB kernel configs
This is done via a custom Kconfiglib based script, that allows to merge
in all USB configs from a provided one into the current. The script finds
and enabled all USB configs and their dependencies.
2019-05-13 17:10:34 +02:00
Dmitry Vyukov
000f08bb18 sys/linux: switch ppc64le to little-endian
make extract recently broke for powerpc on linux-next with:

include/uapi/linux/byteorder/big_endian.h:6:2: error: #error "Unsupported endianness, check your toolchain"
 #error "Unsupported endianness, check your toolchain"

Turns out we always built ppc64le headers as big-endian.
First, kernel was configured as BE.
Then, we used gcc to build an executable program for host
and on x86 gcc does not define __LITTLE_ENDIAN__ so kernel
thought that the toolchain is BE too.

Configure kernel as LE and define __LITTLE_ENDIAN__.

This actually changes values of some consts,
but fortunately just few of them.
2019-05-13 10:26:57 +02:00
Anton Lindqvist
5f302c04a2 sys/openbsd: add missing padding arguments
Due to missing padding arguments, stack garbage could end up being used as
actual arguments. More reading for the curious[1].

While here, add missing descriptions for pread and pwrite.

[1] https://flak.tedunangst.com/post/syzkaller-found-a-bug
2019-05-12 14:03:04 +02:00
Anton Lindqvist
c017728b48 sys/openbsd: avoid raw root disk node creation (#1171)
Writing to the raw root disk could lead to all kinds of corruptions[1].

[1] https://flak.tedunangst.com/post/syzkaller-found-a-bug
2019-05-11 13:10:47 -07:00
Dmitry Vyukov
46caad9460 sys/linux: add few new bpf consts 2019-05-10 15:39:27 +02:00
Dmitry Vyukov
16c44697b5 sys/linux: add definitions of fsopen, fspick, fsconfig, fsmount, move_mount syscalls 2019-05-10 15:21:16 +02:00
Dmitry Vyukov
cfeec85937 sys/linux: add new consts/flags/fields here and there
Add a bunch of new small interfaces in 5.2: new consts, flags, fields, etc.
2019-05-10 14:31:20 +02:00
Dmitry Vyukov
f5cecf2e32 sys/linux: add new fou attributes 2019-05-10 13:18:51 +02:00
Dmitry Vyukov
0a05e35530 sys/linux: add description of open_tree syscall 2019-05-10 13:13:46 +02:00
Dmitry Vyukov
4af714615a sys/linux: regenerate consts on the latest linux-next tree
Fuse version was bumped.
2019-05-10 13:06:50 +02:00
Dmitry Vyukov
c1718ecf4e sys/linux: fix alignment of cmsghdr_sock
All cmsg's must be intptr aligned within the array.
2019-05-10 13:05:04 +02:00
Kaipeng Zeng
c2aed7c7e3 sys/linux: update descriptions of sendmsg/sendmmsg
Fix the descriptions of cmsghdr.
Add sendmsg$sock and sendmmsg$sock for __sock_cmsg_send.
2019-05-10 13:00:44 +02:00
Anton Lindqvist
1852eb1814 sys/openbsd: add vmm descriptions (#1152)
Most probably limited to input validation for now. In the future, it
could be extended to provide a bootable kernel during vm create (/bsd)
and turn vmid into a proper resource.

The OpenBSD VMs on GCE does support vmm(4).
2019-05-01 19:30:36 -07:00
Michael Tuexen
7516d9fa93 sys/freebsd: add support for various network protocols
Add support for Ethernet, IPv4, ICMP, IPv6, ICMP6, TCP, and UDP.
This work is based on the corresponding Linux support.
2019-05-01 19:27:45 +02:00
Michael Tuexen
618456b4f4 sys/freebsd: include ioccom.h in pf.txt
This is needed for the IORW() macros.
2019-04-30 17:55:00 +02:00
Michael Tuexen
a46bda82a4 sys/syz-extract define GENOFFSET when processing FreeBSD sources
This avoids the inclusion of offset.inc files.
2019-04-30 17:55:00 +02:00
Kristof Provost
2398edeacc sys/freebsd: Add pf ioctl()s
Tweak the building of the FreeBSD vm image to ensure pf is loaded at
startup, so that we can test it.
2019-04-23 15:55:07 +02:00
Marco Vanotti
53199d6e8a Update syscalls (#1116)
* sys/fuchsia: update all syscalls.

This commit modifies all the existing syscalls definitions to match more
closely the documentation in the Fuchsia repo.

* run make extract && make generate
2019-04-22 11:08:29 -07:00
Dmitry Vyukov
c402d8f1aa sys/linux: add pidfd_send_signal 2019-04-12 18:26:28 +02:00
Dmitry Vyukov
c41e6ff180 sys/linux: more tty descriptions 2019-04-12 18:11:09 +02:00
Dmitry Vyukov
4f421599f9 sys/linux: add simple io_uring descriptions
We don't actually communicate with the uring yet,
but this already finds a bunch of bugs.
2019-04-12 16:19:23 +02:00
Andrey Konovalov
44841b9f9c all: run make generate 2019-04-11 16:24:45 +02:00
Andrey Konovalov
f4a3dc9128 all: add basic USB fuzzing support
This commits implements 4 syzcalls: syz_usb_connect, syz_usb_io_control,
syz_usb_ep_write and syz_usb_disconnect. Those syzcalls are used to emit USB
packets through a custom GadgetFS-like interface (currently exposed at
/sys/kernel/debug/usb-fuzzer), which requires special kernel patches.

USB fuzzing support is quite basic, as it mostly covers only the USB device
enumeration process. Even though the syz_usb_ep_write syzcall does allow to
communicate with USB endpoints after the device has been enumerated, no
coverage is collected from that code yet.
2019-04-11 16:24:45 +02:00
Andrey Konovalov
10e721ba92 sys: add USB descriptions
This commit adds syzkaller descriptions for USB fuzzing. The descriptions in
vusb.txt are written manually and cover different kinds of USB descriptors.
The descriptions in init_vusb_ids.go are generated automanitally by the
syz-usbgen tool and contain the vendor, device and some other IDs that
map to different USB drivers.
2019-04-11 16:24:45 +02:00
Anton Lindqvist
5701183bd3 sys/openbsd: add pci descriptions 2019-04-05 10:22:46 +02:00
Cody Holliday
e5d1b3ac44 sys/targets: fix arm target compiler prefix
sys/targets/targets.go: Change 'arm-linux-gnueabihf-' to 'arm-linux-gnueabi-' in the arm target since target ISA is armv6 and armhf is armv7+.
2019-04-04 14:57:50 +02:00
Marco Vanotti
4949990eea sys/fuchsia: Remove object_*_cookie syscalls. (#1099)
Those syscalls were removed from Zircon in a recent CL[0].

This commit runs make extract && make generate to update syscalls and
fidl interfaces.

[0]: https://fuchsia-review.googlesource.com/c/fuchsia/+/249349
2019-04-03 15:30:56 -07:00
Dmitry Vyukov
162bd26be4 pkg/compiler: make buffer alias to ptr[array[int8]]
Ptr type has special handling of direction (pointers are always input).
But buffer type missed this special case all the time.
Make buffer less special by aliasing to the ptr[array[int8]] type.
As the result buffer type can't have optional trailing "opt" attribute
because we don't have such support for templates yet.
Change such cases to use ptr type directly.

Fixes #1097
2019-04-01 12:46:10 +02:00
Anton Lindqvist
3e1cf9ad8a executor: connect tun and bpf devices on OpenBSD 2019-04-01 12:39:02 +02:00
Anton Lindqvist
4ba360c5fb sys/openbsd: add common ioctl() commands 2019-04-01 12:39:02 +02:00
Anton Lindqvist
98c1bf1cfb sys/openbsd: add bpf descriptions 2019-03-29 08:51:39 +01:00
houjingyi
934bb8cade modify 2019-03-29 07:47:14 +01:00
Dmitry Vyukov
8a528bedaa sys/linux: move copyright to the top of the file 2019-03-27 14:34:18 +01:00
Noa Osherovich
d1419fc79f Sys/linux: Add rdma.txt
Initial description of the kernel's RDMA subsystem.
This patch covers most of the older write() interface as well as the
some ioctl functions.
Also disable rdma_cm's ib_qp_type flags as it conflicts with rdma's
definition, and rdma builds first.

Signed-off-by: Noa Osherovich <noaos@mellanox.com>
2019-03-27 14:31:07 +01:00
Dmitry Vyukov
4e668495fb sys/syz-extract: fix too long line 2019-03-27 09:44:01 +01:00
Marco Vanotti
70d776a21a sys/sys-extract: update import path for fuchsia.
Apparently, sysroot/include doesn't exist in the build-zircon path
anymore. I changed the path in sys-extract to make it point to the
exported sdk include path.

I also ran make extract and make generate to add new fidl definitions.

TEST=ran make extract and make generate.
2019-03-27 09:08:05 +01:00
Dmitry Vyukov
52a20ba400 dashboard/app: properly handle build failures
Separate kernel and syzkaller build failures.
Fix logic to understand when a build is fixed:
look if kernel/syzkaller commit changes to understand
if it's a new good build or re-upload of an old build.

Fixes #1014
2019-03-25 17:00:25 +01:00
Shankara Pailoor
acbc5b7d05 sys/linux: move openat to dev_rtc.txt
move openat$rtc to rtc_dev and change return type to fd_rtc
2019-03-24 09:28:43 +01:00
Marco Vanotti
14799fb2ef docs, pkg/vcs, sys/fuchsia: update fuchsia urls
Recently the fuchsia team decided to merge all their subrepos into one
big git repo. This meant that the "zircon" repo doesn't exist anymore.
Instead almost everything is under the fuchsia repo.

This change updates all the reference I could find in the code that
point to the zircon and docs repo to make them point to the new fuchsia
repo.
2019-03-20 07:50:58 +01:00
Dmitry Vyukov
28c04d39e0 sys/linux: disable SYSLOG_ACTION_CLEAR
For context see:
https://groups.google.com/d/msg/syzkaller/8nUJCnMfark/y8HOM_vrCQAJ
2019-03-19 14:33:45 +01:00
Mark Johnston
0dbba7ad6c sys/targets: use kernel.full instead of kernel.debug
The latter contains only debug symbols and is meant to be used with the
kernel executable.  That is, the kernel executable contains a
.gnu_debuglink pointer to kernel.debug.  kernel.full contains
everything, including a copy of the kernel's text section, which we want
when enumerating __sanitizer_cov_trace_pc() calls for a coverage report.
2019-03-19 10:26:46 +01:00
Dmitry Vyukov
61f9c92f3a sys/linux: restrict SYSLOG_ACTION_CONSOLE_LEVEL
Fuzzer must not mess with console, turn it on/off, change log level, etc.
Otherwise it turns off kernel output on console.
2019-03-18 13:35:11 +01:00
Anton Lindqvist
4656becafb sys/openbsd: add chflags descriptions 2019-03-18 08:52:35 +01:00
Alexander Popov
0d081107be sys/linux: Add rfkill description for Linux 2019-03-18 08:51:27 +01:00
Dmitry Vyukov
d72db19b2a sys/syz-extract: support more identifier quoting options
That's insanity compilers shuffle them in all possible combinations.
2019-03-14 15:30:58 +01:00
Dmitry Vyukov
1e8208402d sys/linux: regenerate and fix const files
1. Move fsverity descriptions to a separate file which
is not regenerated automatically. It was dropped from linux-next.
2. Fix tlk_device.txt name in syz-extract.
3. Update some socket consts e.g. s/SO_TIMESTAMPING/SO_TIMESTAMPING_OLD/.
4. Regenerate const files on current upstream head.
2019-03-14 13:40:11 +01:00
Dmitry Vyukov
4b69c3cbac pkg/runtest: make tests pass on freebsd
The problem is stupid: <endian.h> should be included as <sys/endian.h> on freebsd.
Pass actual host OS to executor build as HOSTGOOS and use it to figure out
how we should include this header.
2019-03-07 20:37:43 +01:00
Mark Johnston
4fc2fa55ac sys/freebsd: avoid mangling syscall names
syz-extract was removing certain prefixes from syscall names, but this
caused some problems:
- freebsd* prefixes are for compatibility syscalls when the syscall ABI
  has changed.  For instance, we have both fstat() and
  freebsd11_fstat(), and it is desirable to fuzz them both.
- Stripping prefixes may leave us with undefined SYS_ constants.  This
  resulted in some test failures in pkg/csource, which emitted code
  referencing SYS_semctl when it should have been SYS___semctl.

Fix the problem by updating syscall descriptions to match the names
given by the FreeBSD kernel.  Add some new descriptions for
compatibility syscalls, fix the mknodat() description (dev_t is now 64
bits wide on FreeBSD), and remove mknod$loop, which appears to be
Linux-specific.
2019-03-07 19:46:55 +01:00
Julia Hansbrough
7ff74a9832 sys/fuchsia/fidlgen: update FIDL path & extract new descriptions
Garnet-layer FIDL descriptions are in a new subdirectory.

This CL changes it to the proper directory, and performed a "make
extract" shortly after.

This should fix some of the errors on the Syzkaller hub.
2019-02-21 11:17:00 +01:00
houjingyi
c4218108d7 sys/linux: add netlink seg6 descriptions
* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload
2019-02-21 09:37:22 +01:00
Dmitry Vyukov
22f84b5e56 sys/linux/test: use pipe2 instead of pipe
pipe does not exist on arm64.
2019-02-13 15:58:42 +01:00
Dmitry Vyukov
2502eeaa79 sys/linux/test: disable tipc test
It still crashes kernel, disable for now.
2019-02-13 15:58:42 +01:00
Dmitry Vyukov
f5827293e2 hafnium: add basic support
Add [very] basic support for testing Hafnium:
https://hafnium.googlesource.com/hafnium

Update #996
2019-02-12 18:34:25 +01:00
Dmitry Vyukov
6258c9f721 sys/linux: regenerate consts
Regenereate consts on latest linux-next.
2019-02-12 18:34:25 +01:00
Dan Robertson
13f1d0047a sys/linux: add NDISC packet formats to vnet.txt
Add the basic NDISC (RFC 4861) packet formats to sys/linux/vnet.txt.
2019-02-11 18:10:35 +01:00
Dmitry Vyukov
fa6c7b7080 sys/linux: prohibit opening /proc/self/exe
Fuzzer manages to open it and do bad things with it.
Prevent it from doing so.
2019-02-08 16:30:44 +01:00
Dmitry Vyukov
8c1621bede sys/linux: prohibit EXT4_IOC_RESIZE_FS
When we run with sandbox=none, test program can do EXT4_IOC_RESIZE_FS which
shrinks rootfs basically to 0. This breaks the machine as all tests then fail with:

failed to create temp dir: mkdir syzkaller-testdir077269498: no space left on device

This is the most common source of "lost connection" crashes overall and
they are not actually kernel bugs.

Prohibit EXT4_IOC_RESIZE_FS for now.
Alternatively we can mount tmpfs with sandbox=none.

Update #971
2019-02-08 09:29:15 +01:00
Dmitry Vyukov
aa4feb0329 sys/linux: extend key descriptions 2019-02-07 09:39:35 +01:00
Dmitry Vyukov
cd7a3c250f sys/linux: move {i,fa}notify into own files 2019-02-07 09:39:35 +01:00
Marco Vanotti
d25487bc2e sys/fuchsia: fix fidlgen issues
* sys/fuchsia: fix fidlgen issues.

This change modifies fidlgen removing fuchsia.mediacodec and renaming
zircon-ethernet to fuchsia-hardware-ethernet.

fuchsia.mediacodec has most of its functionality merged into
fuchsia.media and it's not included in the default amd64 builds.

zircon-ethernet has been renamed to fuchsia-hardware-ethernet
recently:

https://fuchsia-review.googlesource.com/c/zircon/+/237178

* docs/fuchsia: Add troubleshooting sections

This commit adds a troubleshooting section in the fuchsia syzkaller docs
that mentions how to solve fidlgen issues when fidl interfaces are
removed or renamed.

* sys/fuchsia: remove stale autogenerated files.

* sys/fucsia run make extract && make generate.
2019-02-06 13:33:35 +01:00
Anton Lindqvist
c198d5ddeb sys/openbsd: add missing wscons descriptions (#976) 2019-02-01 22:01:09 -08:00
Andrey Konovalov
9f528bbcc8 sys/linux: rename dev descriptions files
Prefix file names of descriptions of /dev/* files with dev_.
And give some of them more appropriate names.
2019-02-01 14:40:17 +01:00
Dmitry Vyukov
25e10a0434 executor: remove ability to detect kernel bugs
This ability was never used but we maintain a bunch of code for it.
syzkaller also recently learned to spoof this error code
with some ptrace magic (probably intercepted control flow again
and exploited executor binary).
Drop all of it.
2019-01-31 11:35:53 +01:00
Dmitry Vyukov
724adc5445 sys/test/test: add tests for test exiting in the middle of execution 2019-01-31 11:35:53 +01:00
Dmitry Vyukov
31fc335d7c sys/linux/test: fix constraints in ipc test 2019-01-31 11:35:53 +01:00
Dmitry Vyukov
8e579f27d6 prog: fix escaping of C strings
C's \xHH hex constants in strings accept any number of hex digits
(not just 2 or 4). So later non-hex escaped chars glue to the \x construct.
Use \OOO instead as it accepts at most 3 octal digits.
2019-01-31 11:35:53 +01:00
Andrey Konovalov
aa432daf55 sys: use -march=armv6 instead of -march=armv6t2
The latter doesn't work on Raspberry Pi Zero.
2019-01-28 16:49:49 +01:00
Anton Lindqvist
c73f090a5c sys/openbsd: add wscons descriptions, limited to wsdisplay for now 2019-01-26 09:31:18 +01:00
Anton Lindqvist
fc1f188563 sys/openbsd: add openat$tty 2019-01-26 09:31:18 +01:00
Anton Lindqvist
3d7ad96eb0 sys/openbsd: add openat${null,zero} 2019-01-26 09:31:18 +01:00
Siddharth M
ebf7a37c5b pkg/build: add basic support for NetBSD
* Add pkg/build support for NetBSD

* Fix length of characters
2019-01-25 18:16:51 +01:00
Dmitry Vyukov
a3d9f7e34d sys/linux: fix up mptcp descriptions
1. Generate .const files for all arches.
2. Don't extract mptcp consts on android.
3. Remove mptcp includes from vnet.txt.
4. Enable CONFIG_MPTCP in syz-extract (mptcp is not like all other kernel headers).
2019-01-25 16:10:00 +01:00
8litz
6fde58c61b sys/linux: add Multipath TCP description
https://tools.ietf.org/html/rfc6824
2019-01-25 15:42:43 +01:00
Dmitry Vyukov
7be43858a2 sys/linux: add trusty hwrng service
Update #933
2019-01-24 16:49:40 +01:00
Dmitry Vyukov
f586e158c4 sys/linux: add trusty hwkey service
Update #933
2019-01-24 16:49:39 +01:00
Dmitry Vyukov
5db97d84e9 sys/linux: describe trusty storage service interface
Update #933
2019-01-24 16:49:39 +01:00
Dmitry Vyukov
91c9476c39 sys/linux: fix a TODO
We can actually express such size with:
define X25_SUBSCRIP_DEVICE_SIZE	200 - sizeof(long)
2019-01-24 16:49:39 +01:00