457 Commits

Author SHA1 Message Date
Dmitry Vyukov
145029013c sys/linux: add more fs ioctls 2018-06-08 20:21:23 +02:00
Dmitry Vyukov
9dbd63342f sys/linux: minor fixes for aio 2018-06-08 19:26:15 +02:00
Hangbin Liu
f7b27b7a19 sys/linux: add remaining qdisc/tclass/tfilter/actions for netlink route sched
Update #533

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2018-06-08 08:11:20 +03:00
Dmitry Vyukov
645e75f803 executor: make syscall table and number constant
We see some crashes that suggest corruption of the syscall number:

invalid command number 1296 (errno 11)
invalid command number 107 (errno 110)

Make the table and the number constant to prevent corruption.
2018-06-07 15:32:30 +02:00
Dmitry Vyukov
8b06421c04 sys/linux: regenerate consts on tip 2018-06-07 13:13:50 +02:00
Dmitry Vyukov
85e7c1404f sys/linux: add AF_XDP support 2018-06-07 13:13:49 +02:00
Dmitry Vyukov
667b9a6950 sys/linux: fix up midi descriptions 2018-06-07 11:10:49 +02:00
Dmitry Vyukov
a251f32666 sys/fuchsia: disable zx_task_kill
Disable zx_task_kill until we figure out how to prevent executor from killing fuzzer.

Update #594
2018-06-06 20:52:30 +02:00
Dmitry Vyukov
97d44b0288 executor: use linux result convention for fuchsia
In several places we assume that -1 is failure and 0 is OK.
Use this convention for fuchsia as well.
2018-06-06 16:17:04 +02:00
Dmitry Vyukov
d8edd95800 executor: fix zx_port_wait use
The call signature has changed in zircon.
2018-06-06 16:14:00 +02:00
Dmitry Vyukov
41f9540d7a sys/fuchsia: remove ZX_VMO_OP_LOOKUP
It's removed from latest zircon sources.
2018-06-06 10:02:03 +02:00
Denis Efremov
863a24bb5d sys/linux: id field fix in v4l2_event_subscription
The id field in the v4l2_event_subscription structure
currently described as: id len[type, int32].

But all the documentation states is:
"id - ID of the event source. If there is no ID associated
with the event source, then set this to 0. Whether or not
an event needs an ID depends on the event type."

So, the documentation clearly states that:
1. id - is the source of an event
2. type - is the type of an event
3. for some types of events there is no source and id can be 0

According to this 'id int32' is more accurate description of
the field.
2018-06-05 13:33:12 +03:00
Denis Efremov
a316ff9273 sys/linux: add new mount options for xfs && btrfs in kernel v4.17
1. lazytime && nolazytime for xfs
2. nossd_spread for btrfs
2018-06-05 08:47:06 +03:00
Denis Efremov
ead447eb6f sys/linux: fix cdrom rules description && clarification on how to run
1. Comment with clarification on how to run qemu added.
2. Fixed description of int type.

Signed-off-by: Denis Efremov <efremov@linux.com>
2018-06-04 14:36:27 +03:00
Dmitry Vyukov
63f18a76c3 sys/linux: improve /dev/snd/controlC descriptions 2018-06-04 12:07:28 +02:00
Denis Efremov
2f93b54f26 sys/linux: video4linux v4l2_jpegcompression APP_len fix
Signed-off-by: Denis Efremov <efremov@linux.com>
2018-05-29 16:32:01 +02:00
Denis Efremov
e276de775a sys/linux: cdrom generic description
Signed-off-by: Denis Efremov <efremov@linux.com>
2018-05-29 14:06:40 +02:00
Dmitry Vyukov
849705db5c sys/linux: few minor tweaks for bpf 2018-05-18 19:29:27 +02:00
Dmitry Vyukov
d302e81641 sys/linux: add MAP_FIXED_NOREPLACE const 2018-05-18 11:14:56 +02:00
Dmitry Vyukov
738d58ade0 pkg/csource: minimize netdevices and net reset
Add separate options to minimize netdevices setup and net namespace reset.

Fixes #581
2018-05-17 19:57:54 +02:00
Dmitry Vyukov
be1a56115b sys/linux: use optional in tun descriptions 2018-05-17 12:16:18 +02:00
Dmitry Vyukov
256b70f9cf sys/linux: fix duplicate field in struct 2018-05-17 11:45:51 +02:00
Dmitry Vyukov
661fd7b988 executor: revert protection of kcov region
Turns out it's protection of kcov region that causes coverage drop.
Revert it and re-enable coverage filtering.
2018-05-15 09:45:50 +02:00
Dmitry Vyukov
d2284dda40 executor: revert coverage filtering
This causes very significant drop in corpus size. Needs additional debugging.
Revert for now.
2018-05-14 19:34:16 +02:00
Dmitry Vyukov
9467cacb1c executor: protect most of kcov region
We only write to the first page of kcov region.
Protect the rest from the fuzzer.
2018-05-14 15:31:14 +02:00
Dmitry Vyukov
364ad1502f executor: terminate on corrupted coverage
New measures still does not help against fuzzer producing
fake corrupted coverage.
Try to terminate instantly as we detect bad coverage.
2018-05-14 15:30:13 +02:00
Dmitry Vyukov
faf3e3d229 executor: filter out invalid PCs on linux/x86_64
Fuzzer manages to corrupt output region and write random coverage again and again.
Do a sanity range check on coverage PCs to filter out invalid ones.
2018-05-14 11:17:58 +02:00
Dmitry Vyukov
aa5027ae05 executor: randomize output region addr
Fuzzer manages to corrupt output region and write random coverage again and again.
Randomize output region addr to make it harder.
2018-05-14 11:17:24 +02:00
Ioana Ciornei
481f030ccd executor: fix strncpy compile error
gcc8 is stricter when dealing with strings and strncpy and demands that
the size of the actual string to be copied to be explicitly smaller than
the size of the destination, just to make sure the NULL terminator is
taken into considerantion. This patch fixes the issue.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
2018-05-13 16:27:22 +02:00
Dmitry Vyukov
c8229620ff sys/linux: regenerate video4linux consts on the right tree
Now generated on:
https://source.codeaurora.org/quic/la/kernel/msm-4.9 msm-4.9
2018-05-11 15:09:33 +02:00
Dmitry Vyukov
2d35915b13 sys/linux: add missing consts for video4linux.txt
For now other arches are regenerated on upstream tree.
It does not contain a bunch of consts, so we define them to 1 for now.
arm64 consts are left intact.
video4linux.txt is added to "android" files in syz-extract,
so that future make extract runs don't overwrite arm64 consts.

Also fix VIDIOC_G_FBUF argument direction, currently tests crash with:

panic: call ioctl$VIDIOC_G_FBUF: pointer arg 'buffer' has output direction [recovered]
	panic: call ioctl$VIDIOC_G_FBUF: pointer arg 'buffer' has output direction
2018-05-11 14:24:16 +02:00
Hangbin Liu
b88872ba0e sys/linux: add AF_NETLINK/NETLINK_ROUTE SCHED support
Update #533

As TC(net sched) is a large group, I separate it from socket_netlink_route.txt.
Currently I only implement the framework with two qdisc/tclass/filters.
I will add the others later.

v2: Fix tcm_handle major and minor order. Add tcm_handle_offsets.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2018-05-08 17:15:21 +02:00
Dmitry Vyukov
cda1fcb742 sys: dedup mmap code across OSes
Update #538
2018-05-06 16:58:38 +02:00
Dmitry Vyukov
31ea20ce83 sys: move generate files to separate packages
Move generated files to gen subdir. This allows to:
1. Rebuild init.go without rebuilding generated code.
2. Excluding generated files from gometalinter checking.
This makes faster and consume less memory.

Update #538
2018-05-05 15:40:10 +02:00
Dmitry Vyukov
0f503c18d9 gometalinter: enable misspell
Update #538
2018-05-03 15:53:13 +02:00
Dmitry Vyukov
4c24e4a467 gometalinter: enable package comment checking
Update #538
2018-05-03 13:53:01 +02:00
Dmitry Vyukov
d5b114b401 executor: fix read_cover_size signature 2018-04-30 09:23:37 +02:00
Dmitry Vyukov
bb79c6ab16 sys/linux: add few more filesystems with images 2018-04-29 18:59:43 +02:00
Dmitry Vyukov
67bec9bb44 sys/linux: describe block device ioctls
Describe block device ioctls.
Describe sg device ioctls.
Add few more devices.
2018-04-29 18:44:32 +02:00
Dmitry Vyukov
d5a5d04517 sys/linux: a bunch of assorted improvements 2018-04-27 19:52:20 +02:00
Dmitry Vyukov
190d92e056 sys/linux: extend namespace desciptions
Slightly extend namespace descriptions and move
them to a separate file.
2018-04-27 18:47:58 +02:00
Dmitry Vyukov
bcd6198db5 executor: support cover on 32-bit kernels
Detect kernel bitness and properly extract coverage on 32-bit kernels.
2018-04-27 14:33:01 +02:00
Hangbin Liu
73417389ce sys/linux/socket_netlink_route: add routing rules
Also fix RTA_MULTIPATH data type. We only need struct rtnexthop,
no need to use array type.

v1 -> v2:
Use uid and sock_port instead of int32/16. Use flags for FRA_PROTOCOL
and FRA_IP_PROTO.

Add type fib_rule_hdr because even though the structure is same with rtmsg.
The table, action and flags values are not same.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2018-04-25 09:33:09 +02:00
Dmitry Vyukov
bf2018dd07 executor: don't fail when ipv6 is not enabled
Check in checkpoint_iptables is not enough as
reset_iptables will fail even if no tables enabled.
Add similar check to reset_iptables.
2018-04-20 20:14:10 +02:00
Dmitry Vyukov
e5453dd396 executor: increase max image size to 128MB
Images of some filesystems need to be that large (xfs, btrfs, f2fs).
2018-04-19 16:59:49 +02:00
Dmitry Vyukov
3642839c10 sys/linux: add f2fs support 2018-04-19 14:15:31 +02:00
Denis Efremov
4f18337d89 sys/linux: add i2c generic description
Basic description of i2c from SIL2LinuxMP workshop.
2018-04-19 11:34:29 +02:00
Hangbin Liu
d1b2ef6921 sys/linux/socket_netlink_route: update RTM_GETSTATS PAYLOAD format
Update RTM_GETSTATS PAYLOAD format.

Also fix ipv4_getroute and ipmr_getroute PAYLOAD format.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2018-04-19 09:21:00 +02:00
Dmitry Vyukov
b80fd3b5d4 executor: support 32-bit kernels
There is no autodetection yet, but at least bitness
is encapsulated in cover_t type.
2018-04-16 21:52:40 +02:00
Dmitry Vyukov
f24e540fe5 executor: don't fail if IPv6 is not enabled 2018-04-16 21:11:10 +02:00