Commit Graph

5181 Commits

Author SHA1 Message Date
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
Danielle Ratson
6930bbef3b sys/linux: Add port and sb devlink syscalls
Add support for set of devlink port and sb interface syscalls.

Signed-off-by: Danielle Ratson <danieller@mellanox.com>
2020-06-23 17:57:38 +02:00
Dmitry Vyukov
2528093954 sys/targets: fix mknod neutralize for netbsd
mknod on netbsd can now also accept a resource for the last arg.
Fix that and add a test that will catch such things more reliably.
2020-06-23 16:54:07 +02:00
Dmitry Vyukov
b1b6c0ed6d dashboard/app: use DailyLimit=0 to mark disabled reportings
We currently use ConstFilter(FilterHold) to mark disabled reportings.
But this condition is impossible to check (even if we make it a named
function, functions are not comparable).
Use DailyLimit=0 as a way to say the same. Note: previously it was used to say "no limit".
This is needed for the next change that needs to understand the active last reporting.
2020-06-23 16:42:46 +02:00
Dmitry Vyukov
854773ea9f dashboard/app: prohibit dup cycles
Bug dup cycles are not useful and the
rest of the code is not prepared for them.
Prohibit updates that create cycles.
This required to restructure the code to move
the check into the transaction, so that we
can't get cycles even after concurrent updates.

Fixes #1852
2020-06-23 16:42:46 +02:00
Dmitry Vyukov
8e0c064ef4 prog: simplify execContext.write 2020-06-23 16:21:51 +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
Necip Fazil Yildiran
54566aff16 sys/linux: add descriptions for qrtr-tun 2020-06-23 10:34:37 +02:00
Necip Fazil Yildiran
39240c9e93 sys/linux/socket_qipcrtr: enhance desc for qipcrtr
Utilization of special values for port and node ids.
Added desc for sendmsg and recvmsg.
2020-06-23 10:34:37 +02:00
Necip Fazil Yildiran
0c8fbbfce1 sys/linux: add descriptions for qrtr socket
Added descriptions to test Qualcomm's IPC router protocol for sockets.
Update #533.
2020-06-23 10:34:37 +02:00
Necip Fazil Yildiran
125d86d101 CONTRIBUTORS: add Necip Fazil Yildiran 2020-06-23 10:34:37 +02:00
Jukka Kaartinen
1afe15356a tools/syz-reporter: Tool to share/visualize crashes
Goes through crash folder that is stated in the workdir.
Collects the crashes, counts and tags.

usage:
 ./bin/syz-reporter -config manager.cfg

Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
2020-06-22 15:10:31 +02:00
Marco Elver
9843a4a88c docs/syzbot: Add link to GCC 10 2020-06-22 15:09:21 +02:00
Alexander Egorenkov
c446449414 prog/encodingexec: pad data args with zero bytes
We must pad data arguments with known values when serializing
them into the given destination buffer because it could
be reused and contain random bytes from previous use.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-22 13:34:25 +02:00
Ayushi Sharma
eabcced432
sys/netbsd: add common ioctl() commands (#1850)
* sys/netbsd: adding filesystem and communication syscalls

* sys/netbsd: add fix for struct sockaddr_storage and profil(2)

* sys/netbsd: add common ioctl(2) commands

* sys/netbsd: resolving conflicts

Co-authored-by: Siddharth M <siddharth.muralee@gmail.com>
2020-06-21 10:00:43 -07:00
Michael Tuexen
9529a48126 sys/freebsd: update SCTP related socket options for FreeBSD
For implementing sctp_bindx(), FreeBSD uses two IPPROTO_SCTP
level socket options SCTP_BINDX_ADD_ADDR and SCTP_BINDX_REM_ADDR.
The type of the value was changed from struct sctp_getaddresses *
to struct sockaddr_in * or struct sockaddr_in6 * in
https://svnweb.freebsd.org/changeset/base/362451
2020-06-21 12:54:51 -04:00
Ayushi Sharma
4f2acff939
sys/netbsd: increase syscall support (#1805)
* sys/netbsd: increase syscall support

* sys/netbsd: increase syscall support fixed

* sys/netbsd: fixed mknod issue

* sys/netbsd: add fix for getdents, futimes and setpriority
2020-06-21 01:41:23 -07: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
Andrey Konovalov
81abc33188
Update external_fuzzing_usb.md 2020-06-19 19:10:56 +02:00
Andrey Konovalov
2c4fd27e5b dashboard/config, sys/linux: update usb config 2020-06-19 18:43:45 +02:00
Albert van der Linde
123cf502d3 tools/syz-headerparser/headerlib
Added __init__.py as it is required for headerparser.py to run.
Was removed by mistake in 672c10ad7c.
2020-06-19 14:44:08 +02:00
Albert van der Linde
e471d8612c CONTRIBUTORS: add Albert van der Linde 2020-06-19 14:44:08 +02:00
Andrey Konovalov
853595a523
Update setup_ubuntu-host_qemu-vm_x86-64-kernel.md 2020-06-19 12:45:27 +02:00
Dmitry Vyukov
03658df6d9 sys/syz-sysgen: be less verbose if no errors happened
There is little point in printing all targets if no errors happened.
Generation is fast, so this is not even working as a "progress bar".
Only print target if there are any errors.
2020-06-19 11:56:47 +02:00
Dmitry Vyukov
9d10abe406 Makefile: don't reset jobserver
Re-exporting -j resets make jobserver. Don't do that.
Only export -j in top level make invocation.
2020-06-19 11:56:47 +02:00
Dmitry Vyukov
b621d37e81 tools/syz-make: reduce number of make jobs
Ensure that we have at least 1GB per Go compiler/linker invocation.
Go compiler/linker can consume significant amount of memory
(observed to consume at least 600MB). See #1276 for context.
And we have parallelization both on make and on go levels,
this can severe oversubscribe RAM.
Note: the result can be significantly lower than the CPU number,
but this is fine because Go builds/tests are parallelized internally.
2020-06-19 11:56:47 +02:00
Dmitry Vyukov
f7a1d89892 Makefile: cosmetic fixes
1. Use --no-print-directory.
These "Entering directory"/"Leaving directory" messages are completely useless.

2. Use go build instead of go install.
This is just to test build and we don't install anything otherwise.
Don't mess with GOAPTH/bin unnecessarily.

3. Don't export MAKEFLAGS.
It is exported by default.

4. Suppress descriptions up-to-date check output.
It's cryptic and is not particularly useful.
2020-06-19 11:56:47 +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
Jiaheng Hu
b1b22865fc sys/linux: add descriptions for new tipc crypto APIs
Added the TIPC_NLA_NODE_KEY and TIPC_NLA_NODE_ID fields in the
socket_tipc_netlink.txt file. Created a new struct to hold the key.
Created two new descriptions for TIPC_NL_KEY_SET and TIPC_NL_KEY_FLUSH.
The related kernel commits can be seen in
https://git.kernel.org/linus/134bdac39766 and
https://git.kernel.org/linus/e1f32190cf7d.
2020-06-18 09:38:16 -07:00
Jiaheng Hu
c4293ba092 CONTRIBUTORS: add Jiaheng Hu 2020-06-18 09:38:16 -07: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
Marco Elver
3ea11d3f9e docs/syzbot: Update KCSAN related information 2020-06-18 14:24:47 +02:00
Amit Cohen
d45a4d69d8 sys/linux: add support for devlink trap syscalls
Add support for set of devlink trap interface syscalls.

Signed-off-by: Amit Cohen <amitc@mellanox.com>
2020-06-17 18:13:33 +02:00
Amit Cohen
84586a4955 sys/linux/socket_netlink_generic_devlink: use template type for netlink msg
Add template type for netlink msg with CMD and POLICY as
arguments, it can be used for all sendmsg calls in this file.

Refactor the existing code.

Signed-off-by: Amit Cohen <amitc@mellanox.com>
2020-06-17 18:13:33 +02:00
Alexander Egorenkov
9466f7f96e executor: enable KVM generator only on AMD64 arch
Executor KVM generator works only on amd64 linux machines.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-17 17:43:56 +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
Dmitry Vyukov
2e1749a138 CODEOWNERS: remove * entry
Github started adding me as reviewer on all PRs.
This is quite inconvinient because I can't figure out
if author really wants my review, or I was added just because of
the * entry. And then I can't remove myself.
Since I am looking at all PRs anyway, let's try without the * entry.
2020-06-17 17:22:57 +02:00
Dmitry Vyukov
5ee7e3e388 codecov.yml: switch to informational mode
Informational mode should always produce "pass" result:
https://docs.codecov.io/docs/commit-status#informational

I can't get anything useful of these notifications.
E.g. now we have patches that add 1 line,
which gives 0% patch coverage, which results in a failure.
But we have some packages/commands not tested at all,
so we can't require contributors to make that covered.

For overall project coverage I also have not seen
any useful pass/fail results. The criteria highly depends
on the nature of the change. If we set the threshold too low,
we will get lots of effectively false failures. The current 50%
setting effectively means "never fail" anyway.
2020-06-17 17:18:23 +02:00
Ayushi Sharma
b6c46f4351
sys/netbsd: adding filesystem and communication syscalls (#1826) 2020-06-17 02:40:05 -07:00
Andrey Konovalov
b9f3810bc5
Update external_fuzzing_usb.md 2020-06-17 00:35:00 +02:00
Dmitry Vyukov
559fbe2dbe syz-fuzzer: don't include disabled syscall name in panics
These checks still fire episodically [on gvisor instance only?].
I've done several attempts to debug this/extend checks.
But so far I have no glue and we are still seeing them.
They are rare enough to be directly debuggable and to be
something trivial. This may be some memory corruption
(kernel or our race), or some very episodic condition.
They are rare enough to be a problem, so don't include
syscall name so that they all go into a single bug bucket.
2020-06-16 16:10:59 +02:00
Andrey Konovalov
3674152277
Update external_fuzzing_usb.md 2020-06-16 15:36:50 +02:00
Andrey Konovalov
e161d77ee2
Update external_fuzzing_usb.md 2020-06-16 15:31:24 +02:00
Andrey Konovalov
6a34f5e831
Update syzbot.md 2020-06-16 15:17:49 +02:00
Jukka Kaartinen
4ea9d9646e tools/syz-crush: Add debug option
Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
2020-06-16 12:43:23 +02:00
Dmitry Vyukov
baca261187 tools/syz-crush: use standard log package
We always use verbosity 0, there is no point in using
our custom package. Switch to the standard one instead.
2020-06-15 18:57:58 +02:00
Dmitry Vyukov
911738ed1f tools/syz-crush: simplify and tidy
As discussed in #1798.
2020-06-15 18:57:58 +02:00
Jukka Kaartinen
f56b572638 tools/syz-crush: Add feature to run C-program
usage:
  syz-crush -config=config.json creprog.c

Produced output is same as syz-manager produces.
New directory called reproduced_with is added that lists all the
reproducers that triggered the crash.

Example:

~/workdir/crashes  $ tree
.
├── 2a8fff76c6267ecfeaf3530a602ed48afbc4a151
│   ├── description
│   ├── log0
│   ├── log1
│   ├── log2
│   ├── report0
│   ├── report1
│   ├── report2
│   └── reproduced_with
│       └── 17a6ed226769660f3e5dad7b22b13466b938e290.c
├── 2b6b921457afe8cebd0a96ca40f8569e6ee95174
│   ├── description
│   ├── log0
│   ├── log1
│   ├── log2
│   ├── log3
│   ├── log4
│   ├── log5
│   ├── report0
│   ├── report1
│   ├── report2
│   ├── report3
│   ├── report4
│   ├── report5
│   └── reproduced_with
│       ├── 9fb2f5b37bf4428382334e336bbbb201634c7c4c.c
│       └── ab27002b46d19cafb1ebb8b040f0a3b0f8f88974.c

Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
2020-06-15 18:41:13 +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
2a22c77acf .github: add CODEOWNERS
This should automatically assign reviewers/cc corresponding developers.
Add codeowners for OSes for which we have committers.

For details see:
https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
2020-06-14 12:06:43 +02:00