Skip to content

Commit 53d8280

Browse files
executor: added SYZOS-DEBUG logging to syz_kvm_assert_syzos_kvm_exit
Provide visibility into expected vs. actual KVM exit reasons during assertion failures.
1 parent 8fc3779 commit 53d8280

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

executor/common_kvm.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,19 @@ static long syz_kvm_assert_syzos_kvm_exit(volatile long a0, volatile long a1)
4444
uint64 expect = a1;
4545

4646
if (!run) {
47+
#if !SYZ_EXECUTOR
48+
fprintf(stderr, "[SYZOS-DEBUG] Assertion Triggered: run is NULL\n");
49+
#endif
4750
errno = EINVAL;
4851
return -1;
4952
}
5053

5154
if (run->exit_reason != expect) {
55+
#if !SYZ_EXECUTOR
56+
fprintf(stderr, "[SYZOS-DEBUG] KVM Exit Reason Mismatch\n");
57+
fprintf(stderr, " Expected: 0x%lx\n", (unsigned long)expect);
58+
fprintf(stderr, " Actual: 0x%lx\n", (unsigned long)run->exit_reason);
59+
#endif
5260
errno = EDOM;
5361
return -1;
5462
}

0 commit comments

Comments
 (0)