Commit Graph

264 Commits

Author SHA1 Message Date
Dmitry Vyukov
993f4bbae0 sys/linux: modernize arch_prctl descriptions 2018-11-17 15:46:37 -08:00
Dmitry Vyukov
1d44216fcf sys/linux: modernize prctl descriptions
Use one syscall per command, refine arguments, etc.
2018-11-17 15:46:37 -08:00
Dmitry Vyukov
69f24bcad6 sys/linux: move prctl to a separate file 2018-11-17 15:46:36 -08:00
Dmitry Vyukov
93ec27acb5 sys/linux: refine tcp repair descriptions 2018-11-17 15:46:36 -08:00
Shankara Pailoor
4fc13fd6ae 1) making bpf_insn varlen, 2) changing bpf_generic to match the struct definition in linux to make trace2syz generation simpler 2018-11-12 12:41:37 -08:00
Dmitry Vyukov
f3c4e61859 sys/linux: add vimc/vivid/vim2m/vicodec/swradio/radio/vbi/cec devices
Create planar and non-planar vivid devices.
Create each for each test process.
Add swradio/radio/vbi/cec media devices.
2018-11-10 10:38:39 -08:00
Dmitry Vyukov
34c048c0d8 sys/linux: add /dev/dlm* devices 2018-11-10 10:38:38 -08:00
Dmitry Vyukov
4d2f7ff6a5 sys/linux: regenerate on latest kernel 2018-11-10 10:38:37 -08:00
Dmitry Vyukov
4ccf7bb438 sys/linux: limit init_module size argument
Kernel tries to vmalloc whatever we pass as size and it's not accounted against memcg.
As the result it can lead to massive OOM kills of everything running on the machine.
Strictly saying, the same applies to finit_module with a sparse file too,
but there is no simple way to handle that.
2018-10-30 17:42:18 +01:00
shankarapailoor
06a012d997 sys/linux: adding constants for trace2syz to sockets 2018-10-30 17:18:39 +01:00
shankarapailoor
72add0ff6f sys/linux: add perf, kvm, btrfs consts for trace2syz 2018-10-30 14:04:49 +01:00
Shankara Pailoor
8dbb755a2e sys/linux: add additional constants for trace2syz to bpf
Fixes #783
2018-10-30 11:31:42 +01:00
Dmitry Vyukov
12b38f22c1 sys/linux: fix up descriptions
1. Extract consts on the latest linux tree.
2. Don't manually define O_TMPFILE/O_ACCMODE/_LINUX_CAPABILITY_VERSION_N,
   they are defined in kernel headers.
3. Don't use CLOCK_SGI_CYCLE as clock id, it's not implemented.
2018-10-30 11:15:50 +01:00
shankarapailoor
362ef76397 sys/linux: add additional constants for trace2syz 2018-10-30 10:58:45 +01:00
Dmitry Vyukov
fe65cc88ce sys/linux: fix SIOCGIFCONF const 2018-10-29 15:06:53 +01:00
Dmitry Vyukov
b36409b288 sys/linux: fix IP6T_SO_GET_INFO const
Fix copy-paste error.
2018-10-29 14:57:43 +01:00
Dmitry Vyukov
9ca2afa12c sys/linux: open /dev/media* files
Also remove the second syscall for opening of /dev/fd*.
2018-10-28 20:35:35 +01:00
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