Commit Graph

1473 Commits

Author SHA1 Message Date
Dmitry Vyukov
0375051c14 pkg/host: increase executor setup timeout
For context see:
https://groups.google.com/d/msg/syzkaller/7yOtIJGW2sw/Siw8mtu0CAAJ
2020-06-29 07:13:19 +02:00
m00nbsd
a2cdad9d42
executor/netbsd: base nth on 2 (#1874) 2020-06-27 17:24:37 +02:00
Tobias Klauser
9506ea6dcf pkg/host: add support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
1cbaafd119 executor: add support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
a8829ad274 pkg/cover: add support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
9a9f703898 pkg/osutil: implement support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Alexander Egorenkov
b202c7a8a2 pkg/csource: fix casting of parameters for trampolines
Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-26 12:01:33 +02:00
Alexander Egorenkov
aea82c003a sys/linux: first 64bit big-endian architecture s390x
* mmap syscall is special on Linux s390x because
  the parameters for this syscall are passed as a struct
  on user stack instead of registers.
* Introduce the SyscallTrampolines table into targets.Target
  to address the above problem.
* There is a bug in Linux kernel s390x which causes QEMU TCG
  to hang when KASAN is enabled. The bug has been fixed
  in the forthcoming Linux 5.8 version. Until then do not enable
  KASAN when using QEMU TCG, QEMU KVM shall have no problems with
  KASAN.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-25 23:08:45 +02:00
Alexander Egorenkov
bbad15ae75 target: support of big-endian architectures
* Introduce the new target flag 'LittleEndian' which specifies
  of which endianness the target is.
* Introduce the new requires flag 'littleendian' for tests to
  selectively enable/disable tests on either little-endian architectures
  or big-endian ones.
* Disable KD unit test on s390x architecture because the test
  works only on little-endian architecture.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-23 21:24:30 +02:00
Alexander Egorenkov
e5d10a4327 ipc: fix endianness issues
Use native byte-order for IPC and program serialization.
This way we will be able to support both little- and big-endian
architectures.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-23 16:18:44 +02:00
Alexander Egorenkov
c655ec77ca executor: fix endianness problem in internet checksum
csum_inet_update does not handle odd number of bytes
on big-endian architectures correctly. When calculating
the checksum of odd number of bytes, the last byte must be
interpreted as LSB on little-endian architectures and
as MSB on big-endian ones in a 16-bit half-word.

Futhermore, the checksum tests assume that the underlying architecture
is always little-endian. When a little-endian machine stores
a calculated checksum into memory, then the checksum's bytes
are automatically swapped. But this is NOT true on a big-endian
architecture.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-19 20:49:11 +02:00
Alexander Egorenkov
bc258b506d pkg: support compiler triple for 'nm' and 'addr2line'
In preparation to support big-endian architectures.
2020-06-18 19:31:40 +02:00
Alexander Egorenkov
7c48e54f9c pkg/ipc: support C compiler in non-standard location
If C compiler is installed e.g. in /opt then
we have to import LD_LIBRARY_PATH.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-18 16:48:02 +02:00
Andrey Konovalov
4d2d1ebee3 pkg/report: stop using questionable frames
Most likely reports without proper stack traces were caused by a bug in the
unwinder and are now fixed in 187b96db5ca7 "x86/unwind/orc: Fix
unwind_get_return_address_ptr() for inactive tasks".

Disable trying to use questionable frames for now.

Fixes #1834
2020-06-17 17:42:50 +02:00
Marco Elver
8e3ab94116 executor: Improve used terminology
Improve used terminology by using better verbs to express the effect of
the whitelist/blacklist.

This also changes executor to exclusively show respectful log messages,
and as per recent conversion, converts the last such case.
2020-06-15 09:56:18 +02:00
Dmitry Vyukov
f5ba047583 pkg/build: extract "multiple definition" linker errors 2020-06-14 11:48:08 +02:00
m00nbsd
dbce178a0e
sys/netbsd: support multiple vHCI buses (#1822) 2020-06-13 12:10:16 +02:00
Dmitry Vyukov
6fe5725de8 pkg/report: ingore another android debug output that looks like kernel crash 2020-06-12 08:23:36 +02:00
Alexey Kardashevskiy
c6ec8ed9ce cover/report: Extend call instruction parser for PPE64 little endian
This adds one more pattern in the list of recognized once as this is
what they look like in objdump:
c0000000001c21a8:       f9 d2 11 48     bl      c0000000002df4a0 <__sanitizer_cov_trace_pc>

Signed-off-by: Alexey Kardashevskiy <aik@linux.ibm.com>
2020-06-12 05:54:26 +02:00
Dmitry Vyukov
588020678f all: use more respective language
Some terms are normalised on the technical level
but may be oppressive on a societal level.
Replace them with more technically neutral terms.
See the following doc for a longer version:
https://tools.ietf.org/id/draft-knodel-terminology-00.html
2020-06-11 23:19:34 +02:00
m00nbsd
0f23e882fa
sys/netbsd: add support for fault injection (#1817) 2020-06-11 23:16:52 +02:00
Ricardo Cañuelo
8648bd1f6d tools: add custom udev rules to generated images
Add a default udev rule file to the image creation process in
create-gce-image.sh and create-image.sh.

This change creates a default rule to make udev create a custom-named
symlink for the specific vim2m device.
2020-06-10 13:09:12 +02:00
Dmitry Vyukov
2c2b926cb7 .golangci.yml: reduce function line count from 200 to 140
140 lines should be enough for everyone.
2020-06-07 10:41:01 +02:00
Dmitry Vyukov
3f04838a10 .golangci.yml: make goconst checker more strict 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
cdf1aa4dc3 pkg/report: deduplicate code across netbsd and openbsd 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
21b79583f1 .golangci.yml: enable receiver name check for pkg/ast 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
70854cd639 .golangci.yml: enable lll for pkg/report/linux.go 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
0e2e52a87a .golangci.yml: reduce scope of suppressions
Reduce scope of some suppressions (some are violated only in some packages).
Remove some outdated, fix and enable the type switch warning.
2020-06-07 10:41:01 +02:00
Marco Vanotti
c3e9afb345 executor/fuchsia: Don't map memory as executable.
Fuchsia has strict controls over who can map memory as executable.
Refactoring syz-executor to be able to do that involves a non trivial
amount of work: it needs to run as a fuchsia component and replace stdin
for some other mechanism to communicate with syz-fuzzer (probably a fidl
service and a thin client that proxies stdin/stdout to syz-fuzzer via
ssh).

Mapping memory as executable doesn't seem to be used or needed in
syz-executor at all. After talking with Dmitry, he mentioned that it was
used in a deprecated feature: `syz_execute_func` which would execute
random code. It also allows more scenarios during fuzzing.

For now, I'm removing that option to allow syzkaller continue fuzzing.

This change also refactors all of the error messages adding a string
representation of the `zx_status_t` in error logs.
2020-06-05 16:46:48 -03:00
Dmitry Vyukov
48b44e1ce0 .golangci.yml: reenable dupl checker
At some point it was enabled, but then somehow got disabled.
Re-enable and fix some regressions.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
2b2857bd21 .golangci.yml: enable funlen checker
Checks for too long functions (based on lines and statements).
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
2fcb2b5c16 .golangci.yml: enable gocognit checker
Finds too complex functions.
Similar to gocyclo, but uses somewhat different metric.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
e3d77cf2a3 .golangci.yml: enable godot checker
A good one. Lots of fixed comments are contributed by episodic contributors.
So it's good to catch these earlier.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
26ae0a0edd .golangci.yml: enable goprintffuncname checker
Only 1 warning. Good to fix and enable before we get more.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
6c22a3d2dd .golangci.yml: enable nestif checker
Prevents functions with too many nested if's.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
503fd5b2f7 .golangci.yml: enable whitespace checker
Points to bad empty lines very precisely.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
555756280e pkg/compiler: remove unused statement 2020-06-05 12:23:19 +02:00
Dmitry Vyukov
1f837d8b35 pkg/report: improve "using smp_processor_id() in preemptible code" parsing 2020-06-04 12:16:25 +02:00
Dmitry Vyukov
a5ce5de0ae pkg/report: update "using X in preemptible code" bug 2020-06-03 12:46:37 +02:00
Dmitry Vyukov
2ba71ec506 pkg/repro: don't enable features missing on the target
Manager has already checked what features are present on the target.
But if we detected that, say, USB is missing, we still enabled it
in the starting csource options. This is wrong, increases configuration
minimization time and may lead to some obscure bugs.
2020-06-03 11:35:08 +02:00
Matthew Dempsky
a86ce602b3 syz-runtest: disable csource tests for HostFuzzer targets
HostFuzzer targets require that we cross-compile the csource tests and
then copy them to the target system. The code to copy files is
currently missing from syz-runtest; also, at least for Fuchsia (which
uses HostFuzzer mode), cross-compiling is non-trivial.
2020-06-03 10:30:14 +02:00
Dmitry Vyukov
06417ff868 pkg/report: add tests for rcu stalls in kmem_cache_alloc
I though maybe we need special handling for them:
stop at kmem_cache_alloc function. But now I am not sure.
This can also be an infinite loop which calls kmalloc/kfree.
Let's not change code for now, just fix things with tests
(this is a good representative set).
2020-06-02 17:47:56 +02:00
Andrey Konovalov
c98aaf984a pkg/report: improve report titles 2020-06-02 17:23:51 +02:00
Dmitry Vyukov
2b26ad000f pkg/cover: skip test on akaros
Akaros compiler does not support coverage.
2020-06-02 13:39:30 +02:00
Dmitry Vyukov
d56234396c pkg/cover: support coverage reports on fuchsia 2020-06-02 13:39:30 +02:00
Dmitry Vyukov
6f3e1c7c67 pkg/build: chmod key file before running qemu
In case the original key has wrong permissions.
Ssh is very picky about key permissions.
2020-05-30 11:04:21 +02:00
Dmitry Vyukov
2510d1afaa pkg/report: avoid producing no guilty file
If we produce no guilty file at all, the report is mailed only to LKML,
which is mostly equivalent to mailing to nobody.
If we skip all files, return the first one.
2020-05-29 15:27:43 +02:00
Dmitry Vyukov
f9f8a06c7c pkg/cover: fix test name output 2020-05-29 13:01:39 +02:00
Andrey Konovalov
6c68daf098 executor: fix printing null master in netlink_device_change
The issues is only present with verbose debugging enabled.

executor/common_linux.h: In function ‘void netlink_device_change(nlmsg*, int, const char*, bool, const char*, const void*, int, const char*)’:
executor/common_linux.h:380:7: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  380 |  debug("netlink: device %s up master %s: %s\n", name, master, strerror(err));
2020-05-29 09:50:00 +02:00
Dmitry Vyukov
7e7ceb21ba pkg/build: chmod output ssh key
ssh is very picky about ssh key permissions.
Let's enforce the right persmissions without bothering user with this.
2020-05-29 08:30:49 +02:00