janus icon indicating copy to clipboard operation
janus copied to clipboard

Can't mount generated testcase iso image (tmp.img) and can't compile generated testcase program (tmp.c)

Open TejasDuseja opened this issue 4 years ago • 2 comments

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.

TejasDuseja avatar Nov 17 '19 06:11 TejasDuseja

I have encountered the same problem. Any solutions or interpretation?

uestcmahone avatar Mar 27 '20 03:03 uestcmahone

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).

peng-hui avatar Mar 07 '22 04:03 peng-hui