Commit Graph

4083 Commits

Author SHA1 Message Date
Paul Chaignon
c9364a4648 sys/linux: support for loopkup-free map value accesses
A new BPF instruction that allows lookup-free map value accesses was added
in Linux v5.2, with commit d8eca5b ("bpf: implement lookup-free direct
value access for maps").  It enables direct access to map values without
having to call a BPF helper.  It is currently used to implement global
variable support.

This commit adds support for that new instruction.

Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-09-17 14:41:41 +02:00
Veronica Radu
13dcda9b39 updated golangci.yml to exclude new errors 2019-09-17 13:02:55 +02:00
Andrey Konovalov
51ca0454d7 pkg/osutil: fix arm build
pkg/osutil/osutil_linux.go:44:13: cannot use info.Totalram (type uint32) as type uint64 in return argument
2019-09-16 14:15:38 +02:00
Michael Tuexen
cb93629971 sys/freebsd/sys.txt: update sendfile description
The signature of sendfile() on FreeBSD is different from the one
used on Linux.
2019-09-16 10:39:16 +02:00
Michael Tüxen
55c50e708b
sys/freebsd/vnet.txt: replace IPPROTO_SEP by IPPROTO_DCCP (#1401)
r350749 updated the constant from IPPROTO_SEP to IPPROTO_DCCP
to be consistent with the IANA registry.
2019-09-16 09:51:17 +02:00
Yevgeny Pats
32d593576a fix fuzzit script to work with latest CLI syntax
Signed-off-by: Yevgeny Pats <yp@fuzzit.dev>
2019-09-13 15:37:40 +01:00
Marco Vanotti
40fa42bc27 executor/fuchsia: close vmo handle in syz_mmap.
This commit fixes a handle leak in syz_mmap. The bug was pointed out by
mdempsky during a code review.

The `syz_mmap` function creates a VMO and maps it to a VMAR in the address
specified by the `syz_mmap` parameters. Once a VMO is mapped to a vmar,
the handle to the vmo can be closed without problems.

The new code makes sure that `zx_handle_close(vmo_handle)` gets called before
the `syz_mmap` function returns.
2019-09-12 21:17:27 -03:00
Yevgeny Pats
0b7672eeaf updated fuzzit to v2.4.46 2019-09-12 08:59:42 +01:00
Marco Vanotti
f4e53c1037 executor/fuchsia: don't crash on syz_mmap failure.
syz_mmap is a pseudo-syscall that can be used by syzkaller in fuzzing
programs, however, it is also used to setup the environment for
syz-executor. syz-executor already checks the return value[0] when it is
used for setting up the environment, so it doesn't make sense for the
function to crash (most probably, in a fuzzing program it will be called
with arguments that would make it fail).

The previous behavior was causing a bunch of "Lost connection to test
machine" syzkaller crashes which were meaningless. An example of a
program in which syz_mmap would crash would be any program in which the
handle to the root vmar is closed before calling syz_mmap.

[0]:
a60cb4cd84/executor/executor_fuchsia.h (L15)
2019-09-11 16:38:45 -03:00
Marco Vanotti
000d39a9b8 pkg/ipc: Send output from syz-executor for non-Forkserver oses.
This change reuses the logic for sending the output back from
syz-executor to syz-fuzzer that forkserver oses use: reading it
periodically. This will be useful for debugging issues in Fuchsia that
does not support forkserver yet.
2019-09-11 16:38:45 -03:00
Andrey Konovalov
a60cb4cd84 executor/usb: use UTF16 encoding for default string
Also respond with lang ID when string #0 is requested.
2019-09-06 20:11:54 +02:00
Andrey Konovalov
3fe4b3b1aa executor/usb: fix null-ptr-deref in syz_usb_control_io 2019-09-06 20:11:54 +02:00
Andrey Konovalov
1af11d9328 executor/usb: improve debugging messages 2019-09-06 20:11:54 +02:00
Andrey Konovalov
a381ceb297 sys/linux/usb: fix CDC mac address encoding 2019-09-06 20:11:54 +02:00
Andrey Konovalov
35d270e58c sys/linux/usb: always provide device string ids
This forces the kernel to make a USB string request and select a lang ID
early during the enumaration stage.
2019-09-06 20:11:54 +02:00
Andrey Konovalov
2d7c71133a executor/usb: allow syz_usb_control_io args to be 0 2019-09-06 20:11:54 +02:00
Andrey Konovalov
4280382fb9 sys/linux/vusb.txt: properly describe interfaces for USB CDC NCM
Also rename cdc_ethernet to cdc_ecm.
2019-09-06 17:19:55 +02:00
Andrey Konovalov
a38da1b89a sys/linux, executor: basic support for multiple USB interfaces 2019-09-06 17:19:55 +02:00
Dmitry Vyukov
acb5b744f9
docs: add another research paper 2019-09-06 13:50:39 +02:00
Andrey Konovalov
c16be727a6 executor: fix sigsegv for default USB string response 2019-09-05 19:03:35 +02:00
Andrey Konovalov
bf6bcce4f2 sys/linux/vusb.txt: fix typo in descriptions 2019-09-05 16:28:13 +02:00
Andrey Konovalov
040fda5884 tools/syz-usbgen: ignore building keyboard.c 2019-09-04 15:59:38 +02:00
Andrey Konovalov
24cb2b46b8 docs: update USB fuzzing documentation 2019-09-04 13:53:01 +02:00
Andrey Konovalov
d994512dff sys/linux, dashboard: update USB config 2019-09-04 13:09:49 +02:00
Andrey Konovalov
6c19c36919 dashboard/config: improve config generation scripts
1. Use MAKE_ARGS var to pass arguments to make.
2. Pass -m to merge_config.sh to avoid calling make without CC.
3. Make util_add_syzbot_extra_bits() operate on .config.
2019-09-04 13:09:49 +02:00
Andrey Konovalov
3977854c2a
pkg/compiler: remove fixed TODO (#1376) 2019-09-04 12:58:59 +02:00
Zubin Mithra
05c2dc45fb dashboard/app: fix typo and change reporting description
* Fix a typo in mail_bisect_result.txt related to the "syz fix:" line.
* Improve the description to make it clearer why sending a "syz fix:" is
important.
2019-09-04 11:01:18 +02:00
Veronica Radu
5de425bc59 prog: implemented argument and call priorities 2019-09-04 10:46:46 +02:00
Dmitry Vyukov
b0e5f924b5 pkg/report: update ODEBUG warning format
It seems something has changed in the kernel again...
2019-09-04 10:35:20 +02:00
Andrey Konovalov
12381952e3 sys/linux/vusb.txt: fix unused EPSNUM param 2019-09-04 07:10:15 +02:00
Andrey Konovalov
a50398545a pkg/compiler: detect unused template params 2019-09-04 07:10:15 +02:00
Andrey Konovalov
526709ff04
prog: move all flag mutation logic into flags() (#1362)
This makes it a bit easier to understand.

Also fix an issue with using flag value as bit number.
2019-09-03 17:02:04 +02:00
Veronica Radu
dbd627eb61 prog: add implementation for resource centric 2019-09-03 16:30:45 +02:00
Dmitry Vyukov
8d48456885 tools/syz-symbolize: fix kernel dir calculation
syz-symbolize did not use the common mgrconfig logic
to calculate kernel dirs. Thus KernelBuildSrc ended up empty,
+dirs were not extended to absolute paths.
Use the common mgrconfig logic to calculate kernel dirs.
2019-09-03 15:00:40 +02:00
Andrey Konovalov
7ca47f80a8
pkg/report: improve USB reports (#1372) 2019-09-03 14:09:51 +02:00
ITWOI
48448e715b docs: add CC="$GCC/bin/gcc" to setup_ubuntu-host_qemu-vm_x86-64-kernel.md (#1368)
Use the same GCC version when configuring and building Linux kernel.
2019-09-03 13:27:41 +02:00
Dmitry Vyukov
14544a569e pkg/build: fix linux make invocation
-j flag is weird, make fails on -j=N.
2019-09-02 07:41:19 +02:00
Dmitry Vyukov
db7c31ca79 pkg/build: make linux builds more deterministic
Kbuild inserts build timestamp into every build.
This makes vmlinux change always even if no present.
Make the build more deterministic.
We plan to use it for detecting no-op changes during bisection.

Update #1271
2019-09-01 20:42:42 -07:00
Dmitry Vyukov
aaf9e5bb5e pkg/build: factor out linux make execution
Remove duplication when calling linux make.
2019-09-01 20:42:35 -07:00
Dmitry Vyukov
584f940baf dashboard/app: fix fix bisection tests
Currently TestBisectFixRetry  fails because it assumes emails
about crash on ToT are not sent. But we currently send them
in tests. Make the behavior consistent between tests and prod.

Update #1371
2019-09-01 20:42:31 -07:00
Dmitry Vyukov
9a1a17ad11 dashboard/app: temporary disable fix bisection reporting
Update #1371
2019-09-01 20:42:20 -07:00
Zubin Mithra
bad3cce26c dashboard/app: allow reporting of BisectFix results
* Modify mail_bisect_result.txt to allow for sending fix bisection
results.
* Modify BisectResult to have a Fix field; introduce selectBisect for
use within the template for choosing between BisectCause/BisectFix
fields.
* Modify bisectFromJob() to return BisectResult with Fix field set if
relevant.
* Modify the tests inside bisect_test.go to account for bisect fix
related reporting emails.
* Modify incomingMail() to ignore any emails from syzbot itself.
2019-08-30 19:50:12 -07:00
Andrey Konovalov
bcd7bcc296 prog: speed up resource ctors detection
When we build a list of resource constructors we over and over iterate through
all types in a syscall to find resource types. Speed it up by iterating only
once to build a list of constructors for each resource and then reuse it.
This significantly speeds up syz-exeprog startup time on Raspberry Pi Zero.
2019-08-30 12:51:28 -07:00
Anton Lindqvist
9adfa8760f pkg/report: improve witness extraction for OpenBSD
Reports from witness regarding returning to userspace with locks held is not
unique enough, causing all lock leaks to be grouped under the same bug.
Instead try to extract the name of syscall where the first held lock was
grabbed.

While here, shorten the title a bit.
2019-08-30 06:13:56 -07:00
Zubin Mithra
cd626f3ba9 dashboard/app: retry BisectFix if crash still occurs on ToT
If a crash occurs on ToT when doing fix bisection, retry the job after
30 days. Add TestBisectFixRetry() to ensure that jobs are retried after
30 days if bisection results in crash on ToT.
2019-08-28 15:34:44 -07:00
Andrey Konovalov
40203c152e
Update setup_linux-host_qemu-vm_arm-kernel.md 2019-08-28 19:16:38 +02:00
Andrey Konovalov
3885d1e2ad
Update setup_linux-host_qemu-vm_arm-kernel.md 2019-08-28 18:55:01 +02:00
Greg Steuck
1eb076e9b7
tools/create-openbsd: switch to 6.6 (#1363) 2019-08-27 18:20:23 -07:00
Matthew Dempsky
fd37b39ea8 all: convert Fuchsia to use "host fuzzing" mode
Go support is not a priority for Fuchsia at the moment, so it's
preferable to use host fuzzing mode for Fuchsia like currently done
for Akaros.

This commit basically looks for all the places where there was special
logic for OS=="akaros" and extends the same logic for OS=="fuchsia".
2019-08-27 14:39:18 -07:00
Andrey Konovalov
d21c5d9de0 dashboard/app: include dashboard link in job reports 2019-08-24 13:42:14 -07:00