Commit Graph

4450 Commits

Author SHA1 Message Date
Andrey Konovalov
eef6e5808d
Update external_fuzzing_usb.md 2019-12-13 23:59:12 +01:00
Andrey Konovalov
9d84e2277c
Update external_fuzzing_usb.md 2019-12-13 23:53:59 +01:00
Andrey Konovalov
408bbb8461
Update external_fuzzing_usb.md 2019-12-13 23:53:10 +01:00
Anton Lindqvist
5b2ca5dad8 dashboard/config: enable KQUEUE_DEBUG on OpenBSD
Recently introduced used to validate correctness of kqueue event lists.
2019-12-13 20:25:07 +01:00
Dmitry Vyukov
a5c1ab05b3 sys/test: add more tests for bitfields
Add tests for issue #1542

The correct results are obtained with the following program:

struct foo {
	unsigned char	f0;
	unsigned int	f1:4;
	unsigned short	f2:4;
};

struct bar {
	char f0;
	struct foo foo;
};

int main() {
	struct bar y;
	memset(&y, 0, sizeof(y));
	y.f0 = 0x12;
	y.foo.f0 = 0x34;
	y.foo.f1 = 0x56;
	y.foo.f2 = 0x78;
	int i;
	for (i = 0; i < sizeof(y); i++)
		printf("%02x", ((unsigned char*)&y)[i]);
	printf("\n");
}
2019-12-13 15:26:10 +01:00
Andrey Konovalov
2a752b7c5e
Update external_fuzzing_usb.md 2019-12-12 18:23:52 +01:00
Andrew Donnellan
08003f6440 pkg/vcs: Unset various git environment variables when invoking git
If you try to run git-using tests while the GIT_DIR environment variable
(and GIT_WORK_TREE, etc) happens to be set, the tests are going to do fun
and exciting things on a repository that isn't the test repository it tries
to set up.

As it turns out, if you try to run "make test" using git rebase -x, you'll
end up with GIT_DIR set to the syzkaller tree. Hilarity ensues.

Unset GIT_DIR, GIT_WORK_TREE and a few other environment variables when
invoking git - that way it'll default to looking at the working directory
that we have given it, which is what we expect.

Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
2019-12-12 09:56:25 +01:00
Andrei Vagin
df191c7fd0 vm/gvisor: show a list of processes in case of any failures
Signed-off-by: Andrei Vagin <avagin@google.com>
2019-12-12 09:56:13 +01:00
Andrey Konovalov
d973f52833 executor: update raw gadget interface 2019-12-11 19:20:07 +01:00
Dmitry Vyukov
0d368675f8 dashboard/app: report newer crashes in the next reporting
We used to report the newest crash long time ago.
Then we switched to preserving the crash across reporting
stages b/c what reaches next stage may be not what was
sent upstream in the previous one.
However, it seems to cause more problems now than it solves.
Crash classification become much better + some backlog
of bugs was clearer, so we don't have that may glued bugs.
However, in some cases we report notoriously old crashes
which is bad. Switch to the newest crash agian.
Let's see how this works now.
2019-12-11 11:05:32 +01:00
Dmitry Vyukov
7dbfdaf076 pkg/build: improve extraction of build errors
1. Extract multiple error lines (up to 10).
Gives more complete picture, maybe the first one
is not the most indicative one.

2. Replace weird unicode quotes with normal quotes.
These may be mishandled by some systems that don't understand utf-8.
2019-12-11 10:36:35 +01:00
Dmitry Vyukov
101194ebf6 executor: check pwrite return values again
Build with some gcc's fails:

In file included from executor/executor.cc:133:0:
executor/common_linux.h: In function ‘long int syz_read_part_table(long unsigned int, long unsigned int, long int)’:
executor/common.h:117:15: error: ignoring return value of ‘ssize_t pwrite(int, const void*, size_t, __off_t)’, declared with attribute warn_unused_result [-Werror=unused-result]
    __VA_ARGS__;                                 \
               ^
executor/common_linux.h:1279:3: note: in expansion of macro ‘NONFAILING’
   NONFAILING(pwrite(memfd, segs[i].data, segs[i].size, segs[i].offset));
   ^
executor/common_linux.h: In function ‘long int syz_mount_image(long int, long int, long unsigned int, long unsigned int, long int, long int, long int)’:
executor/common.h:117:15: error: ignoring return value of ‘ssize_t pwrite(int, const void*, size_t, __off_t)’, declared with attribute warn_unused_result [-Werror=unused-result]
    __VA_ARGS__;                                 \
               ^
executor/common_linux.h:1364:3: note: in expansion of macro ‘NONFAILING’
   NONFAILING(pwrite(memfd, segs[i].data, segs[i].size, segs[i].offset));
   ^
cc1plus: all warnings being treated as errors
2019-12-10 18:59:06 +01:00
Dmitry Vyukov
cb704a294c executor: fix syz_mount_image
1. It always crashed in cover_reset when coverage is disabled.
2. Use NONFAILING when accessing image segments.
3. Give it additional 100 ms as it may be slow.
4. Add a test for syz_mount_image.
2019-12-10 16:08:35 +01:00
Andrey Konovalov
5a5826a14e sys/linux, dashboard: update USB config and IDs 2019-12-10 12:45:34 +01:00
Dmitry Vyukov
b730d26a8d pkg/vcs: don't CC people on CC (sic)
Update #1441
2019-12-10 12:35:10 +01:00
Dmitry Vyukov
f9f80dd437 pkg/report: use --git-min-percent=15 for get_maintainer.pl
Update #1441
2019-12-10 12:35:10 +01:00
Dmitry Vyukov
c2c19edbcd pkg/vcs: don't bisect linux past 4.6
Fixes #1532
2019-12-10 12:35:10 +01:00
Dmitry Vyukov
7c14332a03 pkg/bisect: minor refactoring
Define the bisection predicate closure in a separate statement,
it become too large over time.
2019-12-10 12:35:10 +01:00
Dmitry Vyukov
277181a63c pkg/bisect: always test parent commit
Fixes #1527
2019-12-10 12:35:10 +01:00
Dmitry Vyukov
4538d6d746 pkg/bisect: add test for #1527
Update #1527
2019-12-10 12:35:10 +01:00
Andrey Konovalov
e068fcf622
Update external_fuzzing_usb.md 2019-12-10 12:34:36 +01:00
Marco Vanotti
4b83c8fbed pkg/repro: refactor vm initialization into new fn
This commit moves the instance initialization inside Run() to a
subroutine to decrease cyclomatic complexity in the Run function.
2019-12-09 15:13:49 -08:00
Marco Vanotti
31e7766c51 syz-ci: always rebuild fuchsia on startup
This commit modifies the manager code in syz-ci to rebuild fuchsia every
time it starts.

When syz-ci starts it is most probably due to a syz-ci update, meaning
that it needs to rebuild fuchsia because the commit version will be
different to the one in syz-executor which is part of the fuchsia image.
2019-12-09 15:13:49 -08:00
Matthew Dempsky
0c158fbe77 pkg/build: include syz-executor in Fuchsia base image
Also, build using source from our own copy of syz-executor instead of
what's currently rolled into Fuchsia.
2019-12-09 15:13:49 -08:00
Marco Vanotti
06ff1e48ee docs/fuchsia: Build syz-executor inside fuchsia.
This commit documents how to build syz-executor as part of fuchsia.
Basically you just need to add two flags to the fx set command: one for
adding syz-executor, and one for telling fuchsia to use your local
syzkaller repository instead of the one in third_party.
2019-12-09 15:13:49 -08:00
Marco Vanotti
607350e438 syz/targets: add SyzExecutorCmd flag
This commit adds a new attribute to syzkaller targets that tells
syzkaller how to invoke the syz-executor command.

Some systems, like Fuchsia, are now building syz-executor as part of the
build, and there is no need to copy it over, or to run it from `/tmp`.
In fact, that might stop working at some time in the future in Fuchsia.

All places that used to copy syz-executor into the target machine will
now check for the SyzExecutorCmd flag, and won't copy it if the flag is
set.
2019-12-09 15:13:49 -08:00
Marco Vanotti
1f9a4e330b sys/targets: change clang++ to clang for fuchsia
Syzkaller binaries are built in C mode even if they are c++ binaries.
Recent clang version (clang++-10) consider this an error/warning,
causing issues during build time.

Change-Id: Ia6d1ab46597efc42772c1c7a63188c3c04a729a7
2019-12-09 15:13:49 -08:00
Marco Vanotti
701420fdad sys/targets: fix path for libdriver.so in Fuchsia 2019-12-09 15:13:49 -08:00
Anton Lindqvist
b31eda3df8 pkg/report: normalize yet another free list modified report on OpenBSD 2019-12-09 11:09:14 +01:00
Dmitry Vyukov
1508f45368 sys/linux: refine few framebuffer/kbd ioctls 2019-12-07 18:45:45 +01:00
Dmitry Vyukov
43c501b983 dashboard/config: enable few more linux configs
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_NFSD_V4_2_INTER_SSC=y
2019-12-07 18:45:07 +01:00
Dmitry Vyukov
85f267515d dashboard/config: fix netbsd kmsan config 2019-12-06 16:55:10 +01:00
Siddharth M
12c3b6cd9a pkg/build: add support to build the NetBSD kernel with KMSan
* Initial KMSan commit
* pkg/buil: kmsan cleanup
* pkg/build: Modify the logic slightly
2019-12-06 11:28:19 +01:00
Dmitry Vyukov
4906fbb698 executor: don't use static_assert
Not all gcc's everywhere support C++11 by default.
We have some old on Travis.
2019-12-06 10:20:58 +01:00
Dmitry Vyukov
ba97c611a3 executor: fix remote coverage setup
Layout of kcov_remote_arg is ABI-dependent,
as the result when 32-bit userspace talks to 64-bit kernel
it does not work out of the box. We need both statically
different structs for kernels of different bitnesses,
but also dynamic dispatch because a 32-bit userspace
can talk to both 64-bit and 32-bit kernels.
2019-12-06 09:47:54 +01:00
Andrey Konovalov
98b4ef2d37 sys/linux: update USB TODOs 2019-12-05 15:53:48 +01:00
Dmitry Vyukov
4fb74474cf pkg/report: fix guilty file extraction in presence of rcu stalls
The the added test for exception from exception corner case.

"BUG: spinlock lockup" fails to respect panic_on_warn and panic
after printing report (though, it's a BUG already, so it should
have been paniced even without panic_on_warn).
As the result we got "spinlock lockup" followed by "rcu stall" report.
And we have that special exception for rcu stalls b/c for them
the most of the report is irrelevant up to apic_timer_interrupt frame.
The code did not expect this weird double-report case and skipped
everything up to apic_timer_interrupt, though it's actually
a lockup in netfilter code.
2019-12-05 12:14:58 +01:00
Andrey Konovalov
036f0b1e8d pkg/report: improve reports titles
Ignore kobject_put in stack frames.
2019-12-05 12:03:11 +01:00
Siddharth Muralee
9fd5a512f3 sys/netbsd: fix the build issues with posix_spawn 2019-12-05 10:06:13 +01:00
Siddharth M
b91ea9289b make required changes to sys/netbsd 2019-12-05 10:06:13 +01:00
R3x
a734d2a6d9 sys/netbsd: add the newer vfork syscall 2019-12-05 10:06:13 +01:00
R3x
e06d2ea701 sys/netbsd: Added posix_spawn and fork syscalls 2019-12-05 10:06:13 +01:00
Dmitry Vyukov
b20883285d syz-ci: add Manager.Disabled config parameter
Useful for temporary disabling a manager for any reason
without completely deleting it from the config.
2019-12-04 13:56:12 +01:00
Dmitry Vyukov
69872e8952 docs/linux/found_bugs.md: add 3 manually reported bugs 2019-12-04 11:56:02 +01:00
Dmitry Vyukov
8b4aa626ce prog: fix typo in comment
Linter says:

prog/prio_test.go:68:15: `probablistic` is a misspelling of `probabilistic` (misspell)
		// for this probablistic test.
		            ^
2019-12-04 09:46:40 +01:00
Dmitry Vyukov
0ecb9746a7 prog: fix TestStaticPriorities
With -short and -race we get only 10 iterations
which is not enough for this probablistic test.
Use at least 100 interations always.
2019-12-03 19:34:24 +01:00
Dmitry Vyukov
a2d178996b vm: add workdir_template functionality
The new manager config argument workdir_template refers to a directory. Optional.
Each VM will get a recursive copy of the files that are present in workdir_template.
VM config can then use these private copies as needed. The copy directory
can be referenced with "{{TEMPLATE}}" string. This is different from using
the files directly in that each instance will get own clean, private,
scratch copy of the files. Currently supported only for qemu_args argument
of qemu VM type. Use example:
Create a template dir with necessary files:
$ mkdir /mytemplatedir
$ truncate -s 64K /mytemplatedir/fd
Then specify the dir in the manager config:
	"workdir_template": "/mytemplatedir"
Then use these files in VM config:
	"qemu_args": "-fda {{TEMPLATE}}/fd"
2019-12-03 18:48:14 +01:00
Dmitry Vyukov
dfe2e9d84a sys/linux: enforce arguments of all syz_open_dev calls
Opening random devices can lead to havoc.
Enforce device major/minor.
2019-12-03 18:48:14 +01:00
Dmitry Vyukov
799e6ffbbe dashboard/app: enable few more tty/console-related configs for linux 2019-12-03 18:48:14 +01:00
Dmitry Vyukov
cbfd910250 sys/linux: more tuning of tty devices
Enable /dev/tty{1-6}. These seem to be special.
Few first connected to framebuffers. But the rest
seem to be different from e.g. tty20 anyway.
Also /dev/tty is different from the rest.
/dev/ttyS3 and /dev/ttyprintk are different.
Properly pair BSD pty terminals.
2019-12-03 18:48:14 +01:00