Commit Graph

247 Commits

Author SHA1 Message Date
Dmitry Vyukov
f00934a9ac sys/linux: add "ofb" crypto-something 2018-10-28 19:49:54 +01:00
Dmitry Vyukov
6ce28678e4 sys/linux: slightly refine perf descriptions
CPU argument can be -1.
It makes sense to mmap perf fd.
2018-10-28 19:22:46 +01:00
Dmitry Vyukov
6e045ca26d sys/syz-extract: support missing arch headers
The latest Linux kernel misses some arch-specific headers on some archs:
	asm/a.out.h
	asm/prctl.h
	asm/mce.h
Support that.
2018-10-28 19:10:11 +01:00
Denis Efremov
e6806d0f73 sys/linux: floppy interface description
For floppy fuzzing you need to enable:

1) CONFIG_BLK_DEV_FD in your kernel configuration
2) "cmdline": " -fda FLOPPY.img " in syzkaller configuration

Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Alexander Popov <alex.popov@linux.com>
2018-10-28 19:04:12 +01:00
Dmitry Vyukov
ecb386fe6f sys: check that target consts are defined
Currently when we get target consts with target.ConstMap["name"]
during target initialization, we just get 0 for missing consts.
This is error-prone as we can mis-type a const, or a const may
be undefined only on some archs (as we have common unix code
shared between several OSes).
Check that all the consts are actually defined.
The check detects several violations, to fix them:
1. move mremap to linux as it's only defined on linux
2. move S_IFMT to openbsd, as it's only defined and used on openbsd
3. define missing MAP_ANONYMOUS for freebsd and netbsd
4. fix extract for netbsd
2018-10-19 19:11:22 +01:00
Dmitry Vyukov
6ce17935cb sys/linux: prohibit FAN_OPEN_PERM and FAN_ACCESS_PERM
FAN_OPEN_PERM and FAN_ACCESS_PERM require the program to reply to open requests.
If that does not happen, the program will hang in an unkillable state forever.
See the following bug for details:
https://groups.google.com/d/msg/syzkaller-bugs/pD-vbqJu6U0/kGH30p3lBgAJ
2018-10-15 18:53:00 +02:00
Dmitry Vyukov
58fca249ef sys/linux: add encrypted key instantiation payloads 2018-09-26 15:37:33 +02:00
Dmitry Vyukov
881bc4f956 sys/linux: add IMA mount options 2018-09-26 13:50:35 +02:00
Dmitry Vyukov
134f5f14f4 sys/linux: add ima/evm/capability xattrs 2018-09-25 19:56:45 +02:00
Dmitry Vyukov
30f618d19d sys/linux: add security mount options 2018-09-25 18:47:08 +02:00
Dmitry Vyukov
90fc4b7a89 sys/linux: add erofs descriptions 2018-09-25 17:20:32 +02:00
Dmitry Vyukov
28d9ac763d sys/linux: add lsm attrs and xattrs
Add descriptions for /proc/self/attr/* and known lsm file xattrs.
2018-09-23 20:30:20 +02:00
Tobias Klauser
9ba5d84192 sys/linux: fix RTA_EXPIRES in rtm_ipv6_policy 2018-09-20 16:07:15 +02:00
Tobias Klauser
7f7e03fda2 sys/linux: add MFD_HUGETLB 2018-09-19 13:43:38 +02:00
Tobias Klauser
fe944bbcd7 sys/linux: add MCL_ONFAULT 2018-09-19 13:21:09 +02:00
Dmitry Vyukov
61ed43a86a sys/linux: prohibit EXT4_IOC_SHUTDOWN
EXT4_IOC_SHUTDOWN EXT4_IOC_SHUTDOWN on root fs effectively brings the machine down in weird ways.
2018-09-13 12:02:45 +02:00
Dmitry Vyukov
3c88136c8a sys/linux: add btf descriptions
Add some new bpf descriptions, most notably btf.
Not perfect, but something.
2018-09-11 18:44:54 +02:00
Dmitry Vyukov
8d971420ee sys/linux: extend xattr descriptions
Update #533
2018-09-02 06:47:18 +02:00
Dmitry Vyukov
a4718693a3 sys/linux: add syz_execute_func
The function executes random code.

Update #310
2018-08-30 21:45:04 -07:00
Dmitry Vyukov
4239b99abb sys/linux: add nbd descriptions
Update #533
2018-08-30 21:45:03 -07:00
Dmitry Vyukov
0ed59d7fcd sys/linux: generate better block device names for mount 2018-08-30 21:45:03 -07:00
Dmitry Vyukov
e8dd2c6713 prog: add concept of "special pointers"
Currently we only generate either valid user-space pointers or NULL.
Extend NULL to a set of special pointers that we will use in programs.
All targets now contain 3 special values:
 - NULL
 - 0xfffffffffffffff (invalid kernel pointer)
 - 0x999999999999999 (non-canonical address)
Each target can add additional special pointers on top of this.

Also generate NULL/special pointers for non-opt ptr's.
This restriction was always too restrictive. We may want to generate
them with very low probability, but we do want to generate them.

Also change pointers to NULL/special during mutation
(but still not in the opposite direction).
2018-08-30 21:45:03 -07:00
Dmitry Vyukov
edb2f5f1e1 sys/linux: add ext4 ioctls and overlayfs
Update #533
2018-08-29 15:59:16 -07:00
Dmitry Vyukov
758cd203cb sys/linux: fix kvm_ioeventfd layout 2018-08-26 05:54:16 +02:00
Dmitry Vyukov
0be67307ca sys/linux: add few assorted new flags/ioctls 2018-08-26 05:51:30 +02:00
Dmitry Vyukov
98b0bddc4d sys/linux: treat cuse as fuse
It's mostly fuse.

Also regenerate consts on latest kernel.
2018-08-26 05:17:40 +02:00
Dmitry Vyukov
ce0eccdea6 sys/linux: add IOCB_CMD_POLL 2018-08-26 05:01:08 +02:00
Dmitry Vyukov
77e79ca08e sys/linux: add userio descriptions
Update #533
2018-08-26 04:54:54 +02:00
Dmitry Vyukov
9ccc1d4565 sys/linux: add uinput support 2018-08-15 01:50:08 +02:00
Dmitry Vyukov
0e6dcb8809 sys/linux: add uhid support 2018-08-15 00:10:16 +02:00
Dmitry Vyukov
1be453f07b sys/linux: fix invalid cdrom description 2018-08-10 18:44:31 +02:00
Dmitry Vyukov
3a2fe60529 executor: fix cgroups
1. Create per-proc cgroup in executor.
2. Setup cgroups after chdir into test dir
   (it assumes relative paths against test dir).
3. Add test.
2018-08-09 16:05:46 +02:00
Dmitry Vyukov
922e8e2734 executor: mount binfmt_mist
We forgot to mount binfmt_misc. Mount it. Add a test.
Increase per-call timeout, otherwise last execve timesout.
Fix csource waiting for call completion at the end of program.
2018-08-09 16:05:46 +02:00
Dmitry Vyukov
acf31536e9 executor: clean up immutable dirs
Turns out dirs can be immutable too.

Update #650
2018-08-09 16:05:46 +02:00
Dmitry Vyukov
d46deef51c executor: clean up immutable files
Fixes #650
2018-08-08 15:06:29 +02:00
Dmitry Vyukov
3653592507 pkg/runtest: assorted improvements
Support checking "blocked"/"unfinished" flags for calls.
Support test constanints, e.g. "requires: threaded" or "requires: -sandbox=setuid".
Some improvements in tools/syz-runtest.

Update #603
2018-08-08 15:05:01 +02:00
Dmitry Vyukov
3a7200e49b executor: abort fuse connection
If the test process is not dying after 100ms,
abort all fuse connections in the system.
This gets rid at least of simple fuse deadlocks,
let's see how well this works in all cases.
2018-08-04 17:50:58 +02:00
Dmitry Vyukov
2763e04c22 tools/syz-runtest: add tool for program unit testing
The tool is run as:

$ syz-runtest -config manager.config

This runs all programs from sys/*/test/* in different modes
on actual VMs and checks results.

Fixes #603
2018-08-03 21:08:02 +02:00
Dmitry Vyukov
d9a893a554 Makefile: don't compile all targets into target binaries
Currently target binaries contain support for all OS/arch combinations.
However, obviously a fuchsia target binary won't test windows.
For target binaries we need support only for a single target
(with the exception of 386/arm target in amd64/arm64 binaries).
So compile in only _the_ target into target binaries.
This reduces akaros/amd64 fuzzer binary from 33 to 7 MB
and execprog from 28 to 2 MB.
2018-08-02 19:07:22 +02:00
Dmitry Vyukov
f5d67fbd9c .gometalinter.json: enable gofmt
The part that we want from gofmt is simplify (-s).
Fix all code that needs fixing.

Update #538
2018-07-31 12:16:54 +02:00
Hangbin Liu
570df9b277 sys/linux/socket_netlink_route: add specific policies for IFLA_LINKINFO
Add interface specified policies for IFLA_LINKINFO. I only added the
interfaces we create in initial setup. Remain other types of interfaces
in the TODO list.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2018-07-17 10:08:31 +02:00
Dmitry Vyukov
fcdb43e97d sys/linux: regenerate files 2018-07-13 12:44:14 +02:00
Dmitry Vyukov
f642b4185a sys/linux: improve fuse descriptions 2018-07-12 12:36:38 +02:00
Dmitry Vyukov
95e7a88b97 sys/linux: implement fuse as normal syscalls
Remove syz_fuse* and implement them as normal syscalls.
We not have enough expressive power to form mount options.
2018-07-10 16:18:45 +02:00
Dmitry Vyukov
40ed7e838a sys/linux: use fmt in filesystem options
We currently generate poor formatted intergers,
generate proper integers using the new fmt type.
2018-07-09 21:42:43 +02:00
Dmitry Vyukov
59da9e4393 sys/linux: use negative consts where useful 2018-07-09 20:54:47 +02:00
Dmitry Vyukov
f25e577041 sys/linux: refine 9p descriptions
RVERSION needs to use 0xffff tag, otherwise parsing fails.
Use only tags 1 and 2. They are densely allocated,
so most of the time it's 1. And it needs to be correct in
multiple replies for mount to succeed. So limit tag space.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
4bf3b336eb sys/linux: modernize cgroup descriptions 2018-07-08 22:52:24 +02:00
Dmitry Vyukov
e63a51b4b3 sys/linux: modernize selinux descriptions 2018-07-08 22:52:24 +02:00
Dmitry Vyukov
eb5690a56d sys/linux: extend 9p descriptions
Add actual protocol messages.
2018-07-08 22:52:24 +02:00