Skip to content

Commit c43dd6e

Browse files
Merge pull request #63 from jwpconsulting/mips-persistent-exit-support
Implement AFL persistent exit for mips
2 parents ef1cd9a + b92a965 commit c43dd6e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

linux-user/mips/cpu_loop.c

+12
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ void cpu_loop(CPUMIPSState *env)
8484

8585
switch(trapnr) {
8686
case EXCP_SYSCALL:
87+
if (
88+
persistent_exits &&
89+
(
90+
env->active_tc.gpr[2] == TARGET_NR_exit_group ||
91+
// uclibc may use the following signal instead of
92+
// exit_group:
93+
env->active_tc.gpr[2] == TARGET_NR_exit
94+
)
95+
) {
96+
env->active_tc.PC = afl_persistent_addr;
97+
continue;
98+
}
8799
env->active_tc.PC += 4;
88100
# ifdef TARGET_ABI_MIPSO32
89101
syscall_num = env->active_tc.gpr[2] - 4000;

0 commit comments

Comments
 (0)