janus
janus copied to clipboard
Can't mount generated testcase iso image (tmp.img) and can't compile generated testcase program (tmp.c)
Unable to mount generated testcase iso image. Error says bad superblock. Unable to run tmp.c error says tmp.c:34:10: error: use of undeclared identifier 'SYS_newlstat' syscall(SYS_newlstat, (long)v3, (long)v1); ^ tmp.c:35:10: error: use of undeclared identifier 'SYS_newstat' syscall(SYS_newstat, (long)v5, (long)v1); ^ 2 errors generated.
I have encountered the same problem. Any solutions or interpretation?
Janus directly uses system call constants (e.g., SYS_read
) defined in sys/syscall.h
. The PoC generation part applies the syscall constant as an index to fetch syscall_name defined in Constants.cpp. By checking the syscall contants defined in /usr/include/x86_64-linux-gnu/asm/unistd_64.h
, I found the SYS_newlstat
, SYS_newstat
, and SYS_newfstat
should be updated as SYS_lstat
, SYS_stat
, and SYS_fstat
, respectively, in Constants.cpp to comform the system definition. In other words, just remove the prefix new
to use correct system calls.
(However, I still could not reproduce crashes on my VM).