4498 Commits

Author SHA1 Message Date
Andrey Konovalov
6738e0b30b dashboard/config: disable magic sysrq entirely
It can be reached over tty as well and those path ignore the sysrq_enabled
setting.
2020-01-07 16:17:17 +01:00
Andrey Konovalov
a20859865e pkg/report: add more ignored frames 2020-01-07 16:02:48 +01:00
Dmitry Vyukov
6a8d39b1f4 syz-manager: disable corpus rotation
Temporary disable corpus rotation b/c we suspect it negatively affects fuzzing.
But we don't have hard data, and the easiest way to check is to disable
and see what happens.

Update #1348
2020-01-07 16:01:39 +01:00
Andrey Konovalov
d8c45749bf
Update external_fuzzing_usb.md 2020-01-07 15:33:47 +01:00
Dmitry Vyukov
7042566e4b pkg/email: accept #syz- prefix for commands
Some users spell the command as "#syz-dup:".
Support this and few more variations.
2020-01-07 14:32:50 +01:00
Dmitry Vyukov
36860d8b25 prog: increase array size during mutation
We have strict upper bound of array size 10.
However, for netlink we frequently need lots of attributes in arrays.
Add a mutation that increases array size by few elements
without an upper bound (we should not grow them infinitely due
to coverage feedback?).
2020-01-07 14:31:14 +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
7824163310 pkg/vcs: disable CONFIG_DEBUG_INFO_BTF during bisection
BTF fails lots of builds with:
pahole version v1.9 is too old, need at least v1.13
Failed to generate BTF for vmlinux. Try to disable CONFIG_DEBUG_INFO_BTF.
2020-01-07 11:31:59 +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
Andrey Konovalov
c43471c3ac pkg/repro: simplify C repros over DevlinkPCI 2020-01-07 10:02:02 +01:00
Andrey Konovalov
6738080fea executor: setns requires including sched.h on some setups 2020-01-07 10:02:02 +01:00
Anton Lindqvist
53430d9719 pkg/report: normalize kqueue_check report on OpenBSD 2020-01-06 20:37:03 +01:00
Dmitry Vyukov
438e122712 pkg/host: fix detection of enabled LSMs
securityfs may not be mounted, but it does not mean that no LSMs are enabled.
2020-01-05 17:48:19 +01:00
Dmitry Vyukov
d83499aa56 sys/linux: add NFNL_SUBSYS_CTHELPER/NFNL_SUBSYS_CTNETLINK_EXP descriptions 2020-01-05 17:15:59 +01:00
Andrey Konovalov
28206bb69a dashboard/config: properly extract non tristate config values
The USB config extraction script properly works with symbols that
are either enabled as =m or =y or disabled. This change adds support
for hex, int and string symbol types. (The current distro config used
for USB config generation doesn't contain any values of those types yet.)
2020-01-05 16:21:57 +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
90408076e6 syz-manager: don't show hub stats if hub is not enabled 2020-01-05 11:46:34 +01:00
Dmitry Vyukov
147b97431b syz-manager: show list of all enabled syscalls
1. Show all syscalls even if they don't have coverage yet.
2. Show full syscall names.
3. Show prio/corpus/cover for paticular syscall descrimination.

This allows to check what exactly syscalls are enabled
and see prio/corpus/cover for a single syscall.
2020-01-05 11:46:33 +01:00
Dmitry Vyukov
b726d37627 pkg/host: detect unsupported LSMs 2020-01-05 11:46:32 +01:00
Dmitry Vyukov
682569741a executor: fix IPVLAN_F_VEPA definition again
Now other machines failed with redefinition IPVLAN_F_VEPA.
The #ifndef does not really work the way it should due
to the way pkg/csource preprocesses sources.
IPVLAN_F_VEPA is never defined during preprocessing.
Let's try this.
2020-01-03 21:47:45 +01:00
Dmitry Vyukov
9c216c0182 sys/linux: add vlan/macvlan/ipvlan/mactap device policies 2020-01-03 21:35:40 +01:00
Dmitry Vyukov
0d1a814324 executor: define constants that are missing on some distros 2020-01-03 21:34:46 +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
1bd353000d dashboard/config: update linux config
Enable AFS.
Enable PHONET (enabled in Debian).
Enable IEEE802154_FAKELB (may allow us to reach some of IEEE802154 code).
Enable USB4.
Enable some misc networking configs.
2020-01-03 16:11:49 +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
5e3bc74104 pkg/cover: support out-of-tree linux build
Looks for source files in object dir.
This is required for out-of-tree linux builds.
E.g. security/selinux/flask.h contains some sources
with coverage callbacks, but it's auto-generated
and located in the build dir.
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
7e52950696 syz-manager: init coverage without manager mutex
Coverage initialization takes very long time,
if we hold manager mutex we stall all rpc's and everything.
Do it without manager mutex.
2020-01-03 16:11:49 +01:00
Anton Lindqvist
9dcc1191cb pkg/report: normalize unhandled af report on OpenBSD 2020-01-03 08:37:12 +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
74da6acb21 syz-manager: add a note about corpus rotation
Update #1348
2019-12-30 18:03:59 +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
3203771359 prog: fix a typo in a comment 2019-12-30 16:37:38 +01:00
Dmitry Vyukov
1bd7cab318 .travis.yml: set go_import_path
This should help with testing of forks
(now they should be checked at the correct path).
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
Anton Lindqvist
af6b8ef8f1 docs/openbsd: update found bugs.md 2019-12-28 11:21:02 +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