0vercl0k / wtf

wtf is a distributed, code-coverage guided, customizable, cross-platform snapshot-based fuzzer designed for attacking user and / or kernel-mode targets running on Microsoft Windows and Linux user-mode (experimental!).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERR: Received a message that would not fit in the scratch buffer

donghyunlee00 opened this issue · comments

Why does this error occur?

$ sudo ../../src/build/wtf master --name abc --max_len 10000000 --runs 10000000 --target .
...
#379141 cov: 10839 (+0) corp: 1 (5.3kb) exec/s: 18.2 (1 nodes) lastcov: 5.8hr crash: 0 timeout: 0 cr3: 0 uptime: 5.8hr
#379145 cov: 10839 (+0) corp: 1 (5.3kb) exec/s: 18.2 (2 nodes) lastcov: 5.8hr crash: 0 timeout: 0 cr3: 0 uptime: 5.8hr
Received a message that would not fit in the scratch buffer (1414745936 VS 16777216)
terminate called after throwing an instance of 'yas::io_exception'
  what():  ../libs/yas/include/yas/detail/io/binary_streams.hpp(256): can't read requested bytes
Aborted

The scratch buffer size is 1MB large as you can see in Server_t::Run:

    //
    // Initialize our internal state.
    //

    ScratchBufferGrip_ = std::make_unique<uint8_t[]>(_1MB);
    ScratchBuffer_ = {ScratchBufferGrip_.get(), _1MB};

    if (Opts_.TestcaseBufferMaxSize > ScratchBuffer_.size_bytes()) {
      fmt::print("The biggest testcase would not fit in the scratch buffer\n");
      return EXIT_FAILURE;
    }

In this case, your server received a testcase that is 1414745936 bytes long which wouldn't fit in the 16777216 bytes scratch buffer (note that I've messed up _1MB's value which is in fact 16MB (Page::Size * Page::Size which is incorrect, I'll fix this).

You passed --max_len 10000000 but your fuzzer module is generating a testcase that exceeds that size. How do you run the clients?

Cheers

My bad, I made a mistake while hadnling file system.

+) Is the maximum value of max_len 16777216(0x1000000)?

That's right, but it's a very artificial barrier - patch the constant and you're good to go :)

Cheers

Thanks:)