@@ -635,29 +635,33 @@ void afl_setup(void) {
635
635
636
636
void afl_forkserver (CPUState * cpu ) {
637
637
638
- // u32 map_size = 0;
639
- unsigned char tmp [4 ] = {0 };
640
-
641
638
if (forkserver_installed == 1 ) return ;
642
639
forkserver_installed = 1 ;
643
640
644
641
if (getenv ("AFL_QEMU_DEBUG_MAPS" )) open_self_maps (cpu -> env_ptr , 1 );
645
642
643
+ //u32 map_size = 0;
644
+ unsigned char tmp [4 ] = {0 };
646
645
pid_t child_pid ;
647
646
int t_fd [2 ];
648
647
u8 child_stopped = 0 ;
649
648
u32 was_killed ;
650
649
int status = 0 ;
651
650
652
- // with the max ID value
653
- if (MAP_SIZE <= FS_OPT_MAX_MAPSIZE )
654
- status |= (FS_OPT_SET_MAPSIZE (MAP_SIZE ) | FS_OPT_MAPSIZE );
655
- if (lkm_snapshot ) status |= FS_OPT_SNAPSHOT ;
656
- if (sharedmem_fuzzing != 0 ) status |= FS_OPT_SHDMEM_FUZZ ;
657
- if (status ) status |= (FS_OPT_ENABLED | FS_OPT_NEWCMPLOG );
658
- if (getenv ("AFL_DEBUG" ))
659
- fprintf (stderr , "Debug: Sending status %08x\n" , status );
651
+ if (!getenv ("AFL_OLD_FORKSERVER" )) {
652
+
653
+ // with the max ID value
654
+ if (MAP_SIZE <= FS_OPT_MAX_MAPSIZE )
655
+ status |= (FS_OPT_SET_MAPSIZE (MAP_SIZE ) | FS_OPT_MAPSIZE );
656
+ if (lkm_snapshot ) status |= FS_OPT_SNAPSHOT ;
657
+ if (sharedmem_fuzzing != 0 ) status |= FS_OPT_SHDMEM_FUZZ ;
658
+ if (status ) status |= (FS_OPT_ENABLED | FS_OPT_NEWCMPLOG );
659
+
660
+ }
661
+
660
662
memcpy (tmp , & status , 4 );
663
+ if (getenv ("AFL_DEBUG" ))
664
+ fprintf (stderr , "Debug: Sending status 0x%08x\n" , status );
661
665
662
666
/* Tell the parent that we're alive. If the parent doesn't want
663
667
to talk, assume that we're not running in forkserver mode. */
0 commit comments