📄 scalar.c
字号:
// crappy non-standard syscall. GO(__NR_putpmsg, "5s 0m"); SY(__NR_putpmsg, x0, x0, x0, x0, x0); FAIL; // __NR_vfork 190 GO(__NR_vfork, "other"); // (sse scalar_vfork.c) // __NR_ugetrlimit 191 GO(__NR_ugetrlimit, "2s 1m"); SY(__NR_ugetrlimit, x0, x0); FAIL; // __NR_mmap2 192 GO(__NR_mmap2, "5s 0m"); SY(__NR_mmap2, x0, x0, x0, x0, x0-1, x0); FAIL; // __NR_truncate64 193 GO(__NR_truncate64, "3s 1m"); SY(__NR_truncate64, x0, x0, x0); FAIL; // __NR_ftruncate64 194 GO(__NR_ftruncate64, "3s 0m"); SY(__NR_ftruncate64, x0, x0, x0); FAIL; // __NR_stat64 195 GO(__NR_stat64, "2s 2m"); SY(__NR_stat64, x0, x0); FAIL; // __NR_lstat64 196 GO(__NR_lstat64, "2s 2m"); SY(__NR_lstat64, x0, x0); FAIL; // __NR_fstat64 197 GO(__NR_fstat64, "2s 1m"); SY(__NR_fstat64, x0, x0); FAIL; // __NR_lchown32 198 GO(__NR_lchown32, "3s 1m"); SY(__NR_lchown32, x0, x0, x0); FAIL; // __NR_getuid32 199 GO(__NR_getuid32, "0s 0m"); SY(__NR_getuid32); SUCC; // __NR_getgid32 200 GO(__NR_getgid32, "0s 0m"); SY(__NR_getgid32); SUCC; // __NR_geteuid32 201 GO(__NR_geteuid32, "0s 0m"); SY(__NR_geteuid32); SUCC; // __NR_getegid32 202 GO(__NR_getegid32, "0s 0m"); SY(__NR_getegid32); SUCC; // __NR_setreuid32 203 GO(__NR_setreuid32, "2s 0m"); SY(__NR_setreuid32, x0, x0); FAIL; // __NR_setregid32 204 GO(__NR_setregid32, "2s 0m"); SY(__NR_setregid32, x0, x0); FAIL; // __NR_getgroups32 205 GO(__NR_getgroups32, "2s 1m"); SY(__NR_getgroups32, x0+1, x0+1); FAIL; // __NR_setgroups32 206 GO(__NR_setgroups32, "2s 1m"); SY(__NR_setgroups32, x0+1, x0+1); FAIL; // __NR_fchown32 207 GO(__NR_fchown32, "3s 0m"); SY(__NR_fchown32, x0, x0, x0); FAIL; // __NR_setresuid32 208 GO(__NR_setresuid32, "3s 0m"); SY(__NR_setresuid32, x0, x0, x0); FAIL; // __NR_getresuid32 209 GO(__NR_getresuid32, "3s 3m"); SY(__NR_getresuid32, x0, x0, x0); FAIL; // __NR_setresgid32 210 GO(__NR_setresgid32, "3s 0m"); SY(__NR_setresgid32, x0, x0, x0); FAIL; // __NR_getresgid32 211 GO(__NR_getresgid32, "3s 3m"); SY(__NR_getresgid32, x0, x0, x0); FAIL; // __NR_chown32 212 GO(__NR_chown32, "3s 1m"); SY(__NR_chown32, x0, x0, x0); FAIL; // __NR_setuid32 213 GO(__NR_setuid32, "1s 0m"); SY(__NR_setuid32, x0); FAIL; // __NR_setgid32 214 GO(__NR_setgid32, "1s 0m"); SY(__NR_setgid32, x0); FAIL; // __NR_setfsuid32 215 GO(__NR_setfsuid32, "1s 0m"); SY(__NR_setfsuid32, x0); SUCC; // This syscall has a stupid return value // __NR_setfsgid32 216 GO(__NR_setfsgid32, "1s 0m"); SY(__NR_setfsgid32, x0); SUCC; // This syscall has a stupid return value // __NR_pivot_root 217 GO(__NR_pivot_root, "n/a"); //SY(__NR_pivot_root); // (Not yet handled by Valgrind) FAIL; // __NR_mincore 218 GO(__NR_mincore, "3s 1m"); SY(__NR_mincore, x0, x0+40960, x0); FAIL; // __NR_madvise 219 GO(__NR_madvise, "3s 0m"); SY(__NR_madvise, x0, x0+1, x0); FAILx(ENOMEM); // __NR_getdents64 220 GO(__NR_getdents64, "3s 1m"); SY(__NR_getdents64, x0, x0, x0+1); FAIL; // __NR_fcntl64 221 // As with sys_open(), the 'fd' error is suppressed for the later ones. // For F_GETFD the 3rd arg is ignored GO(__NR_fcntl64, "(GETFD) 2s 0m"); SY(__NR_fcntl64, x0-1, x0+F_GETFD, x0); FAILx(EBADF); // For F_DUPFD the 3rd arg is 'arg' GO(__NR_fcntl64, "(DUPFD) 1s 0m"); SY(__NR_fcntl64, x0-1, x0+F_DUPFD, x0); FAILx(EBADF); // For F_GETLK the 3rd arg is 'lock' // on x86, this fails with EBADF. But on amd64 in 32-bit mode // it fails with EFAULT. GO(__NR_fcntl64, "(GETLK) 1s 0m"); SY(__NR_fcntl64, x0-1, x0+F_GETLK, x0); FAIL; //FAILx(EBADF); // 222 GO(222, "ni"); SY(222); FAIL; // 223 GO(223, "ni"); SY(223); FAIL; // __NR_gettid 224 GO(__NR_gettid, "n/a"); //SY(__NR_gettid); // (Not yet handled by Valgrind) FAIL; // __NR_readahead 225 GO(__NR_readahead, "n/a"); //SY(__NR_readahead); // (Not yet handled by Valgrind) FAIL; // __NR_setxattr 226 GO(__NR_setxattr, "5s 3m"); SY(__NR_setxattr, x0, x0, x0, x0+1, x0); FAIL; // __NR_lsetxattr 227 GO(__NR_lsetxattr, "5s 3m"); SY(__NR_lsetxattr, x0, x0, x0, x0+1, x0); FAIL; // __NR_fsetxattr 228 GO(__NR_fsetxattr, "5s 2m"); SY(__NR_fsetxattr, x0, x0, x0, x0+1, x0); FAIL; // __NR_getxattr 229 GO(__NR_getxattr, "4s 3m"); SY(__NR_getxattr, x0, x0, x0, x0+1); FAIL; // __NR_lgetxattr 230 GO(__NR_lgetxattr, "4s 3m"); SY(__NR_lgetxattr, x0, x0, x0, x0+1); FAIL; // __NR_fgetxattr 231 GO(__NR_fgetxattr, "4s 2m"); SY(__NR_fgetxattr, x0, x0, x0, x0+1); FAIL; // __NR_listxattr 232 GO(__NR_listxattr, "3s 2m"); SY(__NR_listxattr, x0, x0, x0+1); FAIL; // __NR_llistxattr 233 GO(__NR_llistxattr, "3s 2m"); SY(__NR_llistxattr, x0, x0, x0+1); FAIL; // __NR_flistxattr 234 GO(__NR_flistxattr, "3s 1m"); SY(__NR_flistxattr, x0-1, x0, x0+1); FAIL; /* kernel returns EBADF, but both seem correct */ // __NR_removexattr 235 GO(__NR_removexattr, "2s 2m"); SY(__NR_removexattr, x0, x0); FAIL; // __NR_lremovexattr 236 GO(__NR_lremovexattr, "2s 2m"); SY(__NR_lremovexattr, x0, x0); FAIL; // __NR_fremovexattr 237 GO(__NR_fremovexattr, "2s 1m"); SY(__NR_fremovexattr, x0, x0); FAIL; // __NR_tkill 238 GO(__NR_tkill, "n/a"); //SY(__NR_tkill); // (Not yet handled by Valgrind) FAIL; // __NR_sendfile64 239 GO(__NR_sendfile64, "4s 1m"); SY(__NR_sendfile64, x0, x0, x0+1, x0); FAIL; // __NR_futex 240 #ifndef FUTEX_WAIT #define FUTEX_WAIT 0 #endif // XXX: again, glibc not doing 6th arg means we have only 5s errors GO(__NR_futex, "5s 2m"); SY(__NR_futex, x0+FUTEX_WAIT, x0, x0, x0+1, x0, x0); FAIL; // __NR_sched_setaffinity 241 GO(__NR_sched_setaffinity, "3s 1m"); SY(__NR_sched_setaffinity, x0, x0+1, x0); FAIL; // __NR_sched_getaffinity 242 GO(__NR_sched_getaffinity, "3s 1m"); SY(__NR_sched_getaffinity, x0, x0+1, x0); FAIL; // __NR_set_thread_area 243 GO(__NR_set_thread_area, "1s 1m"); SY(__NR_set_thread_area, x0); FAILx(EFAULT); // __NR_get_thread_area 244 GO(__NR_get_thread_area, "1s 1m"); SY(__NR_get_thread_area, x0); FAILx(EFAULT); // __NR_io_setup 245 GO(__NR_io_setup, "2s 1m"); SY(__NR_io_setup, x0, x0); FAIL; // __NR_io_destroy 246 { // jump through hoops to prevent the PRE(io_destroy) wrapper crashing. struct fake_aio_ring { unsigned id; /* kernel internal index number */ unsigned nr; /* number of io_events */ // There are more fields in the real aio_ring, but the 'nr' field is // the only one used by the PRE() wrapper. } ring = { 0, 0 }; struct fake_aio_ring* ringptr = ˚ GO(__NR_io_destroy, "1s 0m"); SY(__NR_io_destroy, x0+&ringptr); FAIL; } // __NR_io_getevents 247 GO(__NR_io_getevents, "5s 2m"); SY(__NR_io_getevents, x0, x0, x0+1, x0, x0+1); FAIL; // __NR_io_submit 248 GO(__NR_io_submit, "3s 1m"); SY(__NR_io_submit, x0, x0+1, x0); FAIL; // __NR_io_cancel 249 GO(__NR_io_cancel, "3s 2m"); SY(__NR_io_cancel, x0, x0, x0); FAIL; // __NR_fadvise64 250 GO(__NR_fadvise64, "n/a"); //SY(__NR_fadvise64); // (Not yet handled by Valgrind) FAIL; // 251 GO(251, "ni"); SY(251); FAIL; // __NR_exit_group 252 GO(__NR_exit_group, "other"); // (see scalar_exit_group.c) // __NR_lookup_dcookie 253 GO(__NR_lookup_dcookie, "4s 1m"); SY(__NR_lookup_dcookie, x0, x0, x0, x0+1); FAIL; // __NR_epoll_create 254 GO(__NR_epoll_create, "1s 0m"); SY(__NR_epoll_create, x0); SUCC_OR_FAIL; // __NR_epoll_ctl 255 GO(__NR_epoll_ctl, "4s 1m"); SY(__NR_epoll_ctl, x0, x0, x0, x0); FAIL; // __NR_epoll_wait 256 GO(__NR_epoll_wait, "4s 1m"); SY(__NR_epoll_wait, x0, x0, x0+1, x0); FAIL; // __NR_remap_file_pages 257 GO(__NR_remap_file_pages, "n/a"); //SY(__NR_remap_file_pages); // (Not yet handled by Valgrind) FAIL; // __NR_set_tid_address 258 GO(__NR_set_tid_address, "1s 0m"); SY(__NR_set_tid_address, x0); SUCC_OR_FAILx(ENOSYS); // __NR_timer_create 259 GO(__NR_timer_create, "3s 2m"); SY(__NR_timer_create, x0, x0+1, x0); FAIL; // __NR_timer_settime (__NR_timer_create+1) GO(__NR_timer_settime, "4s 2m"); SY(__NR_timer_settime, x0, x0, x0, x0+1); FAIL; // __NR_timer_gettime (__NR_timer_create+2) GO(__NR_timer_gettime, "2s 1m"); SY(__NR_timer_gettime, x0, x0); FAIL; // __NR_timer_getoverrun (__NR_timer_create+3) GO(__NR_timer_getoverrun, "1s 0m"); SY(__NR_timer_getoverrun, x0); FAIL; // __NR_timer_delete (__NR_timer_create+4) GO(__NR_timer_delete, "1s 0m"); SY(__NR_timer_delete, x0); FAIL; // __NR_clock_settime (__NR_timer_create+5) GO(__NR_clock_settime, "2s 1m"); SY(__NR_clock_settime, x0, x0); FAIL; FAIL; // __NR_clock_gettime (__NR_timer_create+6) GO(__NR_clock_gettime, "2s 1m"); SY(__NR_clock_gettime, x0, x0); FAIL; // __NR_clock_getres (__NR_timer_create+7) GO(__NR_clock_getres, "2s 1m"); SY(__NR_clock_getres, x0+1, x0+1); FAIL; FAIL; // __NR_clock_nanosleep (__NR_timer_create+8) GO(__NR_clock_nanosleep, "n/a"); //SY(__NR_clock_nanosleep); // (Not yet handled by Valgrind) FAIL; // __NR_statfs64 268 GO(__NR_statfs64, "3s 2m"); SY(__NR_statfs64, x0, x0+1, x0); FAIL; // __NR_fstatfs64 269 GO(__NR_fstatfs64, "3s 1m"); SY(__NR_fstatfs64, x0, x0+1, x0); FAIL; // __NR_tgkill 270 GO(__NR_tgkill, "n/a"); //SY(__NR_tgkill); // (Not yet handled by Valgrind) FAIL; // __NR_utimes 271 GO(__NR_utimes, "2s 2m"); SY(__NR_utimes, x0, x0+1); FAIL; // __NR_fadvise64_64 272 GO(__NR_fadvise64_64, "n/a"); //SY(__NR_fadvise64_64); // (Not yet handled by Valgrind) FAIL; // __NR_vserver 273 GO(__NR_vserver, "ni"); SY(__NR_vserver); FAIL; // __NR_mbind 274 GO(__NR_mbind, "n/a"); //SY(__NR_mbind); // (Not yet handled by Valgrind) FAIL; // __NR_get_mempolicy 275 GO(__NR_get_mempolicy, "n/a"); //SY(__NR_get_mempolicy); // (Not yet handled by Valgrind) FAIL; // __NR_set_mempolicy 276 GO(__NR_set_mempolicy, "n/a"); //SY(__NR_set_mempolicy); // (Not yet handled by Valgrind) FAIL; // __NR_mq_open 277 GO(__NR_mq_open, "4s 3m"); SY(__NR_mq_open, x0, x0+O_CREAT, x0, x0+1); FAIL; // __NR_mq_unlink (__NR_mq_open+1) GO(__NR_mq_unlink, "1s 1m"); SY(__NR_mq_unlink, x0); FAIL; // __NR_mq_timedsend (__NR_mq_open+2) GO(__NR_mq_timedsend, "5s 2m"); SY(__NR_mq_timedsend, x0, x0, x0+1, x0, x0+1); FAIL; // __NR_mq_timedreceive (__NR_mq_open+3) GO(__NR_mq_timedreceive, "5s 3m"); SY(__NR_mq_timedreceive, x0, x0, x0+1, x0+1, x0+1); FAIL; // __NR_mq_notify (__NR_mq_open+4) GO(__NR_mq_notify, "2s 1m"); SY(__NR_mq_notify, x0, x0+1); FAIL; // __NR_mq_getsetattr (__NR_mq_open+5) GO(__NR_mq_getsetattr, "3s 2m"); SY(__NR_mq_getsetattr, x0, x0+1, x0+1); FAIL; // __NR_sys_kexec_load 283 GO(__NR_sys_kexec_load, "ni"); SY(__NR_sys_kexec_load); FAIL; // no such syscall... GO(9999, "1e"); SY(9999); FAIL; // __NR_exit 1 GO(__NR_exit, "1s 0m"); SY(__NR_exit, x0); FAIL; assert(0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -