collabora-online/fuzzer
Miklos Vajna 4433e03492 client session fuzzer: try harder to empty SocketPoll::_newCallbacks on shutdown
The DocumentBroker dtor adds a callback:

	#0  SocketPoll::addCallback(std::function<void ()> const&) (this=0x377dce0 <Admin::instance()::admin>, fn=...) at ./net/Socket.hpp:773
	#1  0x0000000000947db5 in Admin::rmDoc (this=<optimized out>, docKey=...) at wsd/Admin.cpp:544
	#2  0x0000000000bb8192 in DocumentBroker::~DocumentBroker (this=0x61900000e690) at wsd/DocumentBroker.cpp:579

So even if the fuzzer called Admin::instance().poll() on shutdown, there
was one more callback inserted to the list later, leading to OOM in the
long run.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I0832d839b098407fa9e8aadb6f84388a85d62323
2022-05-31 15:10:51 +02:00
..
admin-data LOOLWSD::sendMessageToForKit: add error handling 2021-03-16 10:46:23 +01:00
data rename: remaining lool->cool changes 2021-11-18 14:14:11 +01:00
httpresponse-data http response: check if result would fit into chunkLen 2021-07-08 14:51:11 +02:00
Admin.cpp HttpRequest: add missing config.h include 2021-03-30 12:23:09 +02:00
ClientSession.cpp client session fuzzer: try harder to empty SocketPoll::_newCallbacks on shutdown 2022-05-31 15:10:51 +02:00
HttpResponse.cpp Add a fuzzer for http::Response::readData() 2021-04-23 17:54:36 +02:00
README rename: remaining lool->cool changes 2021-11-18 14:14:11 +01:00

README

These fuzzers are meant to be built and executed inside lode.git's sanitizers
environment (currently enables both asan and ubsan).

online.git can be built the usual way, just the additional `--enable-fuzzers`
flag is needed to build the fuzzers. It is useful to do this in a separate
build tree, since the fuzzers config doesn't produce a `coolwsd` binary.

Run the fuzzers like this:

- Admin:

----
./admin_fuzzer -max_len=16384 fuzzer/admin-data/
----

- ClientSession:

----
./clientsession_fuzzer -max_len=16384 fuzzer/data/
----

- HttpResponse:

----
./httpresponse_fuzzer -max_len=16384 fuzzer/httpresponse-data/
----