trailofbits / sienna-locomotive

A user-friendly fuzzing and crash triage tool for Windows
https://blog.trailofbits.com/user-friendly-fuzzing-with-sienna-locomotive
GNU Affero General Public License v3.0
131 stars 24 forks source link

server: Minimize the number of fatal conditions #369

Open woodruffw opened 6 years ago

woodruffw commented 6 years ago

Many of these could be turned into non-fatal errors or warnings:

grep -n 'LOG_FATAL' server/server.cpp:

103:        SL2_SERVER_LOG_FATAL("failed to snapshot process!");
110:        SL2_SERVER_LOG_FATAL("failed to enumerate processes!");
235:        SL2_SERVER_LOG_FATAL("could not create process lock");
241:        SL2_SERVER_LOG_FATAL("could not obtain process lock");
281:        SL2_SERVER_LOG_FATAL("failed to combine logfile path");
297:        SL2_SERVER_LOG_FATAL("failed to combine working dir path");
303:        SL2_SERVER_LOG_FATAL("failed to combine arenas dir path");
397:        SL2_SERVER_LOG_FATAL("failed to open FKT: %S", target_file);
404:        SL2_SERVER_LOG_FATAL("failed to read file path size from FKT");
411:        SL2_SERVER_LOG_FATAL("failed to read replay buffer size from FKT");
423:        SL2_SERVER_LOG_FATAL("failed to read replay buffer from FKT");
427:        SL2_SERVER_LOG_FATAL("failed to close FKT");
446:            SL2_SERVER_LOG_FATAL("failed to write arena to disk!");
450:            SL2_SERVER_LOG_FATAL("(txsize=%lu) != (FUZZ_ARENA_SIZE=%lu), truncated write?", txsize, FUZZ_ARENA_SIZE);
516:        SL2_SERVER_LOG_FATAL("failed to read run ID");
520:        SL2_SERVER_LOG_FATAL("couldn't stringify UUID");
525:        SL2_SERVER_LOG_FATAL("failed to read function type");
531:        SL2_SERVER_LOG_FATAL("failed to read mutation count");
537:        SL2_SERVER_LOG_FATAL("failed to read mutation type");
542:        SL2_SERVER_LOG_FATAL("failed to read size of mutation filepath");
548:        SL2_SERVER_LOG_FATAL("resource_size >= MAX_PATH");
556:            SL2_SERVER_LOG_FATAL("failed to read mutation filepath");
567:        SL2_SERVER_LOG_FATAL("failed to read mutation offset");
572:        SL2_SERVER_LOG_FATAL("failed to read size of mutation buffer");
635:        SL2_SERVER_LOG_FATAL("failed to write server status");
649:        SL2_SERVER_LOG_FATAL("failed to read run ID");
653:        SL2_SERVER_LOG_FATAL("couldn't stringify UUID");
661:        SL2_SERVER_LOG_FATAL("failed to read mutate count");
668:        SL2_SERVER_LOG_FATAL("failed to read size of replay buffer");
674:        SL2_SERVER_LOG_FATAL("failed to allocate replay buffer");
685:        SL2_SERVER_LOG_FATAL("missing FKT or is a directory: %S", target_file);
691:        SL2_SERVER_LOG_FATAL("failed to write replay buffer");
704:        SL2_SERVER_LOG_FATAL("failed to read arena ID size");
708:        SL2_SERVER_LOG_FATAL("wrong arena ID size %lu != %lu", size, SL2_HASH_LEN * sizeof(wchar_t));
712:        SL2_SERVER_LOG_FATAL("failed to read arena ID");
765:        SL2_SERVER_LOG_FATAL("failed to read arena ID size");
769:        SL2_SERVER_LOG_FATAL("wrong arena ID size %lu != %lu", size, SL2_HASH_LEN * sizeof(wchar_t));
773:        SL2_SERVER_LOG_FATAL("failed to read arena ID");
783:        SL2_SERVER_LOG_FATAL("failed to read arena");
791:        SL2_SERVER_LOG_FATAL("no prior arena to compare against! fuzzer didn't request an initial arena?");
881:        SL2_SERVER_LOG_FATAL("failed to read UUID");
885:        SL2_SERVER_LOG_FATAL("couldn't stringify UUID");
889:        SL2_SERVER_LOG_FATAL("failed to read PID");
903:        SL2_SERVER_LOG_FATAL("failed to write length of crash.json to pipe");
907:        SL2_SERVER_LOG_FATAL("failed to write crash.json path to pipe");
920:        SL2_SERVER_LOG_FATAL("failed to write length of mem.dmp path to pipe");
924:        SL2_SERVER_LOG_FATAL("failed to write mem.dmp path to pipe");
937:        SL2_SERVER_LOG_FATAL("failed to write length of initial.dmp path to pipe");
941:        SL2_SERVER_LOG_FATAL("failed to write initial.dmp path to pipe");
957:        SL2_SERVER_LOG_FATAL("failed to write pong status to pipe");
972:        SL2_SERVER_LOG_FATAL("failed to read UUID");
976:        SL2_SERVER_LOG_FATAL("failed to read tracing/fuzzing flag");
980:        SL2_SERVER_LOG_FATAL("failed to read pid");
986:        SL2_SERVER_LOG_FATAL("couldn't stringify UUID");
1034:        SL2_SERVER_LOG_FATAL("failed to read arena ID size");
1038:        SL2_SERVER_LOG_FATAL("wrong arena ID size %lu != %lu", size, SL2_HASH_LEN * sizeof(wchar_t));
1042:        SL2_SERVER_LOG_FATAL("failed to read arena ID");
1051:        SL2_SERVER_LOG_FATAL("arena ID missing from strategy_map? (map size=%d)", strategy_map.size());
1056:        SL2_SERVER_LOG_FATAL("failed to write strategy advice");
1067:        SL2_SERVER_LOG_FATAL("failed to read arena ID size");
1071:        SL2_SERVER_LOG_FATAL("wrong arena ID size %lu != %lu", size, SL2_HASH_LEN * sizeof(wchar_t));
1075:        SL2_SERVER_LOG_FATAL("failed to read arena ID");
1087:        SL2_SERVER_LOG_FATAL("arena ID missing from strategy_map? (map size=%d)", strategy_map.size());
1094:        SL2_SERVER_LOG_FATAL("Raw arena ID missing from strategy_map? (map size=%d)", strategy_map.size());
1137:                SL2_SERVER_LOG_FATAL("failed to read event");
1267:            SL2_SERVER_LOG_FATAL("could not create pipe");
1283:                SL2_SERVER_LOG_FATAL("CreateThread failed\n");