Commit Graph

5492 Commits

Author SHA1 Message Date
Ruxandra Stăncioi
7d947eb36b sys/linux: add netlink encap type LWTUNNEL_ENCAP_RPL
Added a new encap type, from the lwtunnel_encap_types struct, defined in the
include/uapi/linux/lwtunnel.h file.
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/lwtunnel.h#L16
Update #533.
2020-07-24 12:25:04 +02:00
Dmitry Vyukov
70c104a18f pkg/compiler: fix crash on fmt[flags]
Flags with only 1 value 0 are transformed to ConstType.
Fmt did not expect that.

Fixes #1965
2020-07-23 17:13:55 +02:00
Denis Efremov
340ea5301c sys/linux: remove ioctl$EXT4_IOC_SETFLAGS
It duplicates ioctl$FS_IOC_SETFLAGS. There is no need in a
separate definition.

Signed-off-by: Denis Efremov <efremov@linux.com>
2020-07-22 08:49:14 -07:00
Denis Efremov
38237e24ca sys/linux: make fs flags explicit in ioctl$FS_IOC_SETFLAGS
Make fs flags explicit in FS_IOC_SETFLAGS, FS_IOC_GETFLAGS
ioctls.

Signed-off-by: Denis Efremov <efremov@linux.com>
2020-07-22 08:49:14 -07:00
Denis Efremov
db2522a1a7 sys/linux: change argument type in FS_IOC_[GS]ETFLAGS ioctl
FS_IOC_GETFLAGS, FS_IOC_SETFLAGS ioctls use pointer to int32.

Signed-off-by: Denis Efremov <efremov@linux.com>
2020-07-22 08:49:14 -07:00
Albert van der Linde
5c22da4628 syz/linux: fix formating 2020-07-22 17:25:36 +02:00
Albert van der Linde
8d15279dc3 sys/linux: add descriptions for RTM_(NEW|DEL|GET)MDB
https://elixir.bootlin.com/linux/latest/source/net/bridge/br_mdb.c#L837
2020-07-22 16:28:44 +02:00
Albert van der Linde
35be432a74 sys/linux: add descriptions for RTM_(NEW|DEL|GET)VLAN
https://elixir.bootlin.com/linux/latest/source/net/bridge/br_vlan.c#L2045
2020-07-22 16:28:44 +02:00
Albert van der Linde
ceb0013c7f sys/linux: add descriptions for RTM_(NEW|DEL|GET)ADDRLABEL
https://elixir.bootlin.com/linux/latest/source/net/ipv6/addrlabel.c#L625
2020-07-22 16:28:44 +02:00
Albert van der Linde
abbd98bb91 sys/linux: add descriptions for RTM_(NEW|DEL|GET)LINKPROP
https://elixir.bootlin.com/linux/latest/source/net/core/rtnetlink.c#L5565
2020-07-22 16:28:44 +02:00
Denis Efremov
128cd85fcc sys/linux: cleanup orphaned const files for s390x
These *s390x.const files don't match existing
*.txt files.

Signed-off-by: Denis Efremov <efremov@linux.com>
2020-07-22 07:50:57 +02:00
Andrey Konovalov
21f1765e15 prog: more interations in prio test 2020-07-21 16:47:38 +02:00
Andrey Konovalov
a688ac1353 sys/linux: disable SNAPSHOT_POWER_OFF
It causes shutdowns.
2020-07-21 16:47:38 +02:00
Denis Efremov
e562dd8adf executor: fix build errors in setup_32bit_idt()
GCC10 fails to build the code with errors:
executor/common_kvm_amd64.h:143:64: error: ‘gate.kvm_segment::type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
executor/common_kvm_amd64.h:143:56: error: ‘gate.kvm_segment::base’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Replace 'case 6' with 'case 5' since 'i % 6' results in [0..5].

Signed-off-by: Denis Efremov <efremov@linux.com>
2020-07-21 13:04:43 +02:00
Anton Lindqvist
328906f3da sys/openbsd: break out rlimit
In the hopes of lowering the cyclomatic complexity.
2020-07-21 12:15:13 +02:00
Anton Lindqvist
0d540696af sys/openbsd: remove hardcoded constants 2020-07-21 12:15:13 +02:00
Anton Lindqvist
36f35f4714 sys/openbsd: neutralize sysctl kern.maxclusters
One of "no output from test machine" report causes[1]. Since it's a root
only knob, disallow fiddling with it for now.

[1] https://syzkaller.appspot.com/bug?id=a222a4193c0a9814e02fcc61b7343a5af04a7457
2020-07-21 12:15:13 +02:00
Tobias Klauser
d88894e677 Makefile: set GO111MODULE=off for go get in install_prerequisites
Otherwise the versions in go.mod are updated on running `make
install_prerequisites` leading to inconsistent vendoring errors:

go: inconsistent vendoring in /go/src/github.com/google/syzkaller:
	golang.org/x/net@v0.0.0-20200625001655-4c5254603344: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	golang.org/x/tools@v0.0.0-20200717024301-6ddee64345a6: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	golang.org/x/net@v0.0.0-20200520182314-0ba52f642ac2: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	golang.org/x/tools@v0.0.0-20200626171337-aa94e735be7f: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-07-20 17:03:33 +02:00
Albert van der Linde
4285ffa3fe sys/linux: add generated files 2020-07-20 11:30:15 +02:00
Albert van der Linde
d7a01d53f7 sys/linux: add descriptions for raw character devices 2020-07-20 11:30:15 +02:00
Albert van der Linde
8497067886 dashboard/config: enable raw device driver 2020-07-20 11:30:15 +02:00
Dmitry Vyukov
8caeeeb724 pkg/report: parse linux undead task reports 2020-07-20 10:42:01 +02:00
Zubin Mithra
9c8124727c sys/linux: add descriptions for i915 driver 2020-07-17 15:26:11 +02:00
Zubin Mithra
18d3096670 tools: add udev rule for i915
Add a udev rule to create /dev/i915, a symlink to /dev/dri/card#.

This prevents i915 related syscalls from being exercised during fuzzing
if the driver is not used.
2020-07-17 15:26:11 +02:00
Dmitry Vyukov
54b3c45e28 Makefile: test executor build with clang
To get more compiler coverage and to not let it rot.
clang get detect more bugs statically.
2020-07-16 17:56:13 +02:00
Dmitry Vyukov
5369f4cbc6 Makefile: simplify arch build tests
There is not much value in the current 2 levels of indirections.
2020-07-16 17:56:13 +02:00
Dmitry Vyukov
b090c64363 docs: add a note re pseudo-syscall dependencies 2020-07-16 12:29:42 +02:00
Dmitry Vyukov
5395640c2f docs: add a note re per-field directions 2020-07-16 12:29:42 +02:00
Dmitry Vyukov
c4b454fc54 pkg/runtest: tell ASAN to not mess with our NONFAILING
It seems that different gcc's have different defaults for ASAN flags.
Some fail with:

        run.go:67: nonfailing none/thr/repeat            : FAIL: run 0: call 0 is not executed
            	ASAN:DEADLYSIGNAL
            	=================================================================
            	==67143==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f7b0befb0a2 bp 0x7f7b0cfdad10 sp 0x7f7b0cfda490 T1)
            	    #0 0x7f7b0befb0a1  (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x8d0a1)
            	    #1 0x404bbb in syz_compare(long, long, long, long) (/tmp/utor355225125.0+0x404bbb)
            	    #2 0x403cdf in execute_call(thread_t*) (/tmp/utor355225125.0+0x403cdf)
            	    #3 0x404006 in worker_thread(void*) (/tmp/utor355225125.0+0x404006)
            	    #4 0x7f7b0bc584a3 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x74a3)
            	    #5 0x7f7b0b99ad0e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe8d0e)

            	AddressSanitizer can not provide additional info.
            	SUMMARY: AddressSanitizer: SEGV (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x8d0a1)
            	Thread T1 created by T0 here:
            	    #0 0x7f7b0be9ef59 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f59)
            	    #1 0x406117 in execute_one() (/tmp/utor355225125.0+0x406117)
2020-07-16 12:22:57 +02:00
Cheng-Min Chiang
a3e915fe9b sys/linux: add descriptions for mixer devices
Add descriptions for OSS mixer devices, which includes `/dev/mixer` and
its proc file `/proc/asound/card*/oss_mixer`.  These descriptions should
improve the coverage of `sound/core/oss/mixer_oss.c`.
Update #533.
2020-07-16 09:11:03 +02:00
Andrey Konovalov
561f9a1f6f docs: add instructions on updating syz-env 2020-07-15 09:26:53 +02:00
Dmitry Vyukov
13d5e89e02 executor: remove NONFAILING from pseudo-syscalls
This is not needed anymore afer the previous commit.

Fixes #1918
2020-07-15 09:26:23 +02:00
Dmitry Vyukov
b458f2c1a6 executor: wrap all syscalls into NONFAILING
Currently we sprinkle NONFAILING all over pseudo-syscall code,
around all individual accesses to fuzzer-generated pointers.
This is tedious manual work and subject to errors.
Wrap execute_syscall invocation with NONFAILING in execute_call once instead.
Then we can remove NONFAILING from all pseudo-syscalls and never get back to this.
Potential downsides: (1) this is coarser-grained and we will skip whole syscall
on invalid pointer, but this is how normal syscalls work as well,
so should not be a problem; (2) we will skip any clean up (closing of files, etc)
as well; but this may be fine as well (programs can perfectly leave open file
descriptors as well).

Update #1918
2020-07-15 09:26:23 +02:00
Dmitry Vyukov
6b24f02a11 pkg/runtest: allow to select a subset of tests to run 2020-07-15 09:26:23 +02:00
Dmitry Vyukov
e2f6c0c1b5 sys/targets: don't use HostFuzzer mode for test OS
We set HostFuzzer for all test targets b/c in some contexts
they needed the same special behavior as real HostFuzzer targets
(e.g no checking enabled syscalls).
However, in some other contexts they don't the same special
behavior as real HostFuzzer targets. For example, pkg/ipc
does rate limiting for HostFuzzer and pkg/runtest don't run
C tests for HostFuzzer.

Add special case for test targets in pkg/host,
and don't set HostFuzzer for all test targets
(keep it for one target for better coverage).
2020-07-15 09:26:23 +02:00
Jiaheng Hu
f3bec699b6 sys/linux: add shutdown ioctl for f2fs
Added the shutdown ioctl for f2fs filesystem.
2020-07-14 16:15:53 -07:00
Jiaheng Hu
ada108d08b sys/linux: add ioctls for f2fs file system
Added the description for the ioctls that are specific to the f2fs file
system.
2020-07-14 14:25:29 -07:00
Dmitry Vyukov
1efec8f5c7 dashboard/app: say "issue" instead of "crash"
We've got several complains re using of word "crash" in all syzbot reports, e.g.:
https://groups.google.com/d/msg/syzkaller-bugs/8rFLFgQR9fo/HBYUXIRyBAAJ
https://groups.google.com/d/msg/syzkaller-bugs/3nlcT8Wn7hg/8Th16X3DBAAJ
Another suggested that "crash" is too hard for e.g. a LOCKDEP splat:
https://groups.google.com/d/msg/syzkaller/YzHLAU0dXpI/WOqq1ggBBQAJ

Another terminology complaint was regarding the following fact.
When we test a patch, we only detect if it still triggers _any_ issue
(not necessary the original one). Currently we way "still triggers crash"
(without any article, which is probably wrong from English perspective
anyway). We did not say "the", but people assumed that and complained.
Explicitly say "a".

Also replace all uses of "bug" with "issue" for consistency.
And use "final oops" instead of "final crash", which seems
to be standard terminology at least for Linux:
https://en.wikipedia.org/wiki/Linux_kernel_oops
2020-07-14 23:21:01 +02:00
handeharputlu
609fb51750
sys/linux: /dev/snapshot descriptions (#1934) 2020-07-14 14:51:11 +02:00
Albert van der Linde
6f4580264a prog/alloc: align address allocation for aligned[addr]
Calls to alloc didn't respect the alignment attribute. Now
Type.Alignment() is used to ensure each type is correctly
aligned. Existing descriptions with [align[X]] don't have an
issue as they align to small blocks and default align is to
64 bytes. This commits adds support for [align[X]] for an X
larger than 64.
2020-07-14 12:20:37 +02:00
Albert van der Linde
230553f68f prog/types.go: add Type.Alignment() and TypeCommon.TypeAlign
Type.Alignment() can be used to obtain byte alignment for
correctly allocating aligned memory for the Type.
2020-07-14 12:20:37 +02:00
Andrey Konovalov
ce4c95b3a6 sys/linux: fix make extract on latest linux-next
NFT_BASE_CHAIN was renamed to NFT_CHAIN_BASE.

FTR: make extract on mainline is currently broken to linux-next
only descriptions lately added to sys.txt.
2020-07-13 15:29:38 +02:00
Dmitry Vyukov
f90ec89960 dashboard/config: update config to next-20200710 2020-07-13 09:32:49 +02:00
Dmitry Vyukov
9ebcc5b1a8
docs: add another research paper 2020-07-12 16:09:44 +02:00
Dmitry Vyukov
115e19300f tools/syz-linter: check comments format
Check for capitalization, dots at the end
and two spaces after a period.

Update #1876
2020-07-12 08:22:44 +02:00
Dmitry Vyukov
c1147c8df7 all: fix comments format
Fix capitalization, dots at the end
and two spaces after a period.

Update #1876
2020-07-12 08:22:44 +02:00
Dmitry Vyukov
0faffd0438 syz-ci: set Timeout for bisections
Add Timeout config param for bisections.
Specify timeout in syz-ci as 8h based on the following data.

Out of 1049 cause bisections that we have now:
-  891 finished under  6h (84.9%)
-  957 finished under  8h (91.2%)
-  980 finished under 10h (93.4%)
-  989 finished under 12h (94.3%)
- 1011 finished under 18h (96.3%)
- 1025 finished under 24h (97.7%)

There is also a significant increase in errors/inconclusive bisections after ~8h.
Out of 4075 fix bisections:
- 4015 finished under  6h (98.5%)
- 4020 finished under  8h (98.7%)
- 4026 finished under 10h (98.8%)
- 4032 finished under 12h (98.9%)
Significant increase in errors starts after ~12h.

The current timeout also take into account that bisection jobs
compete with patch testing jobs (it's bad delaying patch testing).
When/if bisection jobs don't compete with patch testing,
it makes sense to increase this to 12-24h.

Fixes #1923
2020-07-12 08:22:14 +02:00
Dmitry Vyukov
1ad470c265 pkg/vcs: don't sandbox syzkaller repo
Currently we sandbox all repos b/c we assumed
that all builds are also sandboxes. But this causes
havoc for bisection/patch testing b/c syzkaller build
is not actually sandboxed anywhere. Build creates
root-owned files and then git can't do anything with them
but don't report errors either:

$ git checkout 8eda0b95 && echo OK
error: unable to unlink old 'sys/linux/gen/386.go': Permission denied
error: unable to unlink old 'sys/linux/gen/ppc64le.go': Permission denied
...
HEAD is now at 8eda0b957e
OK

We trust own sources and we don't test syzkaller patches,
so don't sandbox syzkaller repos.
2020-07-12 08:22:14 +02:00
Mark Johnston
7ba05d2dd6 pkg/build: always truncate loader.conf on FreeBSD
Otherwise we append the same lines to the file upon each build.
2020-07-11 08:49:28 +02:00
Mark Johnston
ca5272b763 pkg/build: load the SCTP and IPSec stacks on FreeBSD
IPSec is not compiled into GENERIC kernels and must be loaded.  SCTP
currently is compiled into GENERIC, but this is expected to change.
2020-07-11 08:49:28 +02:00