Commit Graph

25 Commits

Author SHA1 Message Date
Dmitry Vyukov
9b1f3e6653 prog: control program length
We have _some_ limits on program length, but they are really soft.
When we ask to generate a program with 10 calls, sometimes we get
100-150 calls. There are also no checks when we accept external
programs from corpus/hub. Issue #1630 contains an example where
this crashes VM (executor limit on number of 1000 resources is
violated). Larger programs also harm the process overall (slower,
consume more memory, lead to monster reproducers, etc).

Add a set of measure for hard control over program length.
Ensure that generated/mutated programs are not too long;
drop too long programs coming from corpus/hub in manager;
drop too long programs in hub.
As a bonus ensure that mutation don't produce programs with
0 calls (which is currently possible and happens).

Fixes #1630
2020-03-13 13:16:53 +01:00
Dmitry Vyukov
289a143089 syz-hub: cap total number of programs sent to a manager
If we have way too many programs to send (more than 100000),
cap total number to 100000 and give up sending all.
Otherwise new managers will never chew all this on a busy hub.
2019-11-29 10:46:26 +01:00
Dmitry Vyukov
85d28281fb syz-manager: factor out rpc serving part
Update #605
2018-12-26 10:58:23 +01:00
Dmitry Vyukov
e726bdf922 syz-manager: make rpc communication finer grained
RPC package does excessive caching per connection,
so if a larger object is ever sent in any direction,
rpc connection consumes large amount of memory persistently.
This makes manager consume gigs of memory with large
number of VMs and larger corpus/coverage.

Make all communication done in very limited batches.
2018-06-26 13:59:47 +02:00
Dmitry Vyukov
9fe5658a1b gometalinter: check dot imports
Update #538
2018-05-03 14:41:34 +02:00
Dmitry Vyukov
36d1c4540a all: fix gometalinter warnings
Fix typos, non-canonical code, remove dead code, etc.
2018-03-08 18:48:26 +01:00
Dmitry Vyukov
aef0b7921b syz-hub: fix auth logic
Fix a bug and add a test.
2018-03-05 14:07:02 +01:00
Dmitry Vyukov
228e3d951c syz-hub: don't send all repros to new managers
We how have thousands of repros, running all of them
on new managers will take ethernity.
2018-01-22 13:55:29 +01:00
Dmitry Vyukov
a8561e92f3 syz-manager: don't save/send to dashboard repros from hub 2017-08-07 16:40:18 +02:00
Dmitry Vyukov
8af91f61b4 syz-manager, syz-hub: share repros between managers via hub
Currently hub allows managers to exchange programs from corpus.
But reproducers are not exchanged and we don't know if a crash
happens on other managers as well or not.

Allow hub to exchange reproducers.

Reproducers are stored in a separate db file with own sequence numbers.
This allows to throttle distribution of reproducers to managers,
so that they are not overloaded with reproducers and don't lose them on restarts.

Based on patch by Andrey Konovalov:
https://github.com/google/syzkaller/pull/325

Fixes #282
2017-08-07 15:28:59 +02:00
Dmitry Vyukov
a7b199253f all: use consistent file permissions
Currently we have unix permissions for new files/dirs
hardcoded throughout the code base. Some places use 0644,
some - 0640, some - 0600 and a variety of other constants.

Introduce osutil.MkdirAll/WriteFile that use the default
permissions and use them throughout the code base.

This makes permissions consistent and also allows to easily
change the permissions later if we change our minds.

Also merge pkg/fileutil into pkg/osutil as they become
dependent on each other. The line between them was poorly
defined anyway as both operate on files.
2017-07-03 14:00:47 +02:00
Dmitry Vyukov
c5b6fcddca syz-hub: split client name and manager name
This allows to reduce number of hub clients by grouping managers
and creating one client per such group.
2017-06-29 17:50:44 +02:00
Dmitry Vyukov
949ccff832 pkg/rpctype: from from rpctype 2017-06-17 14:41:15 +02:00
Alexander Popov
7ebca77f72 syz-hub: fix copy-paste error in httpSummary()
Also mention Alexander Popov in AUTHORS and CONTRIBUTORS.
2017-06-14 15:59:45 +03:00
Dmitry Vyukov
ea2295f3e2 pkg/db: move from db 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
23b94422d3 pkg/log: move from log 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
d1032c21a0 pkg/hash: move from hash 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
7e458d6416 syz-hub: send new inputs in smaller parts
Currently hub sends all inputs on first manager connect.
This can be 100K+ inputs and can take long time
and consume tons of memory. Send inputs in 1K parts.

Also increase rpc timeouts as hub still has global mutex.
2017-05-23 16:33:28 +02:00
Dmitry Vyukov
1f0546f0da manager, fuzzer, hub: move common rpc code into rpctype
If hub hangs, it causes all managers to hang as well as they call
hub under the global mutex. So move common rpc code into rpctype
and make it more careful about timeouts (tcp keepalives, call timeouts).
Also don't call hub under the mutex, the call can be slow.
2017-01-30 15:15:37 +01:00
Dmitry Vyukov
8b2c1cb5bb syz-hub: don't flush global corpus after every addition
We already flush in addInputs, no need to flush in addInput.
Also add some logging on start as it can be slow.
2017-01-30 11:02:17 +01:00
Dmitry Vyukov
c1bda19ca7 syz-hub: use db package
Hub accumulates tremendous of programs.
Storing all them in separate files can be very slow.
Use the new db package to store corpus in a single file.
2017-01-16 20:44:56 +01:00
Dmitry Vyukov
a5761fa21b syz-hub: fix log format string 2016-11-22 15:50:31 +01:00
Dmitry Vyukov
dbc7ff3805 manager: unbreak build 2016-11-18 19:18:09 +01:00
Dmitry Vyukov
e8de4be407 manager: enable keepalives on rcp connections
VMs die frequently and it causes orphan tcp rpc connections on manager.
2016-11-18 19:06:04 +01:00
Dmitry Vyukov
cd74cc9cf4 syz-hub: add program
syz-hub is used to exchange programs between syz-managers.
2016-11-17 18:38:10 +01:00