📄 scalar.c
字号:
} // __NR_munmap 91 GO(__NR_munmap, "2s 0m"); SY(__NR_munmap, x0, x0); FAIL; // __NR_truncate 92 GO(__NR_truncate, "2s 1m"); SY(__NR_truncate, x0, x0); FAIL; // __NR_ftruncate 93 GO(__NR_ftruncate, "2s 0m"); SY(__NR_ftruncate, x0, x0); FAIL; // __NR_fchmod 94 GO(__NR_fchmod, "2s 0m"); SY(__NR_fchmod, x0-1, x0); FAIL; // __NR_fchown 95 GO(__NR_fchown, "3s 0m"); SY(__NR_fchown, x0, x0, x0); FAIL; // __NR_getpriority 96 GO(__NR_getpriority, "2s 0m"); SY(__NR_getpriority, x0-1, x0); FAIL; // __NR_setpriority 97 GO(__NR_setpriority, "3s 0m"); SY(__NR_setpriority, x0-1, x0, x0); FAIL; // __NR_profil 98 GO(__NR_profil, "ni"); SY(__NR_profil); FAIL; // __NR_statfs 99 GO(__NR_statfs, "2s 2m"); SY(__NR_statfs, x0, x0); FAIL; // __NR_fstatfs 100 GO(__NR_fstatfs, "2s 1m"); SY(__NR_fstatfs, x0, x0); FAIL; // __NR_ioperm 101 GO(__NR_ioperm, "3s 0m"); SY(__NR_ioperm, x0, x0, x0); FAIL; // __NR_socketcall 102 GO(__NR_socketcall, "XXX"); // (XXX: need to do all sub-cases properly) // __NR_syslog 103 GO(__NR_syslog, "3s 1m"); SY(__NR_syslog, x0+2, x0, x0+1); FAIL; // __NR_setitimer 104 GO(__NR_setitimer, "3s 2m"); SY(__NR_setitimer, x0, x0+1, x0+1); FAIL; // __NR_getitimer 105 GO(__NR_getitimer, "2s 1m"); SY(__NR_getitimer, x0, x0, x0); FAIL; // __NR_stat 106 GO(__NR_stat, "2s 2m"); SY(__NR_stat, x0, x0); FAIL; // __NR_lstat 107 GO(__NR_lstat, "2s 2m"); SY(__NR_lstat, x0, x0); FAIL; // __NR_fstat 108 GO(__NR_fstat, "2s 1m"); SY(__NR_fstat, x0, x0); FAIL; // __NR_olduname 109 GO(__NR_olduname, "n/a"); // (obsolete, not handled by Valgrind) // __NR_iopl 110 GO(__NR_iopl, "1s 0m"); SY(__NR_iopl, x0+100); FAIL; // __NR_vhangup 111 GO(__NR_vhangup, "0s 0m"); SY(__NR_vhangup); SUCC_OR_FAIL; // Will succeed for superuser // __NR_idle 112 GO(__NR_idle, "ni"); SY(__NR_idle); FAIL; // __NR_vm86old 113 GO(__NR_vm86old, "n/a"); // (will probably never be handled by Valgrind) // __NR_wait4 114 GO(__NR_wait4, "4s 2m"); SY(__NR_wait4, x0, x0+1, x0, x0+1); FAIL; // __NR_swapoff 115 GO(__NR_swapoff, "n/a"); //SY(__NR_swapoff); // (Not yet handled by Valgrind) FAIL; // __NR_sysinfo 116 GO(__NR_sysinfo, "1s 1m"); SY(__NR_sysinfo, x0); FAIL; // __NR_ipc 117 // XXX: This is simplistic -- need to do all the sub-cases properly. // XXX: Also, should be 6 scalar errors, except glibc's syscall() doesn't // use the 6th one! GO(__NR_ipc, "5s 0m"); SY(__NR_ipc, x0+4, x0, x0, x0, x0, x0); FAIL; // __NR_fsync 118 GO(__NR_fsync, "1s 0m"); SY(__NR_fsync, x0-1); FAIL; // __NR_sigreturn 119 GO(__NR_sigreturn, "n/a"); //SY(__NR_sigreturn); // (Not yet handled by Valgrind) FAIL; // __NR_clone 120#ifndef CLONE_PARENT_SETTID#define CLONE_PARENT_SETTID 0x00100000#endif // XXX: should really be "4s 2m"? Not sure... (see PRE(sys_clone)) GO(__NR_clone, "4s 0m"); SY(__NR_clone, x0|CLONE_PARENT_SETTID|SIGCHLD, x0, x0, x0); FAIL; if (0 == res) { SY(__NR_exit, 0); FAIL; } // __NR_setdomainname 121 GO(__NR_setdomainname, "n/a"); //SY(__NR_setdomainname); // (Not yet handled by Valgrind) FAIL; // __NR_uname 122 GO(__NR_uname, "1s 1m"); SY(__NR_uname, x0); FAIL; // __NR_modify_ldt 123 GO(__NR_modify_ldt, "3s 1m"); SY(__NR_modify_ldt, x0+1, x0, x0+1); FAILx(EINVAL); // __NR_adjtimex 124 // XXX: need to do properly, but deref'ing NULL causing Valgrind to crash... GO(__NR_adjtimex, "XXX");// SY(__NR_adjtimex, x0); FAIL; // __NR_mprotect 125 GO(__NR_mprotect, "3s 0m"); SY(__NR_mprotect, x0+1, x0, x0); FAILx(EINVAL); // __NR_sigprocmask 126 GO(__NR_sigprocmask, "3s 2m"); SY(__NR_sigprocmask, x0, x0+&px[1], x0+&px[1]); SUCC; // __NR_create_module 127 GO(__NR_create_module, "ni"); SY(__NR_create_module); FAIL; // __NR_init_module 128 GO(__NR_init_module, "3s 2m"); SY(__NR_init_module, x0, x0+1, x0); FAIL; // __NR_delete_module 129 GO(__NR_delete_module, "n/a"); //SY(__NR_delete_module); // (Not yet handled by Valgrind) FAIL; // __NR_get_kernel_syms 130 GO(__NR_get_kernel_syms, "ni"); SY(__NR_get_kernel_syms); FAIL; // __NR_quotactl 131 GO(__NR_quotactl, "4s 1m"); SY(__NR_quotactl, x0, x0, x0, x0); FAIL; // __NR_getpgid 132 GO(__NR_getpgid, "1s 0m"); SY(__NR_getpgid, x0-1); FAIL; // __NR_fchdir 133 GO(__NR_fchdir, "1s 0m"); SY(__NR_fchdir, x0-1); FAIL; // __NR_bdflush 134 GO(__NR_bdflush, "n/a"); //SY(__NR_bdflush); // (Not yet handled by Valgrind) FAIL; // __NR_sysfs 135 GO(__NR_sysfs, "n/a"); //SY(__NR_sysfs); // (Not yet handled by Valgrind) FAIL; // __NR_personality 136 GO(__NR_personality, "1s 0m"); SY(__NR_personality, x0+0xffffffff); SUCC; // __NR_afs_syscall 137 GO(__NR_afs_syscall, "ni"); SY(__NR_afs_syscall); FAIL; // __NR_setfsuid 138 GO(__NR_setfsuid, "1s 0m"); SY(__NR_setfsuid, x0); SUCC; // This syscall has a stupid return value // __NR_setfsgid 139 GO(__NR_setfsgid, "1s 0m"); SY(__NR_setfsgid, x0); SUCC; // This syscall has a stupid return value // __NR__llseek 140 GO(__NR__llseek, "5s 1m"); SY(__NR__llseek, x0, x0, x0, x0, x0); FAIL; // __NR_getdents 141 GO(__NR_getdents, "3s 1m"); SY(__NR_getdents, x0, x0, x0+1); FAIL; // __NR__newselect 142 GO(__NR__newselect, "5s 4m"); SY(__NR__newselect, x0+8, x0+0xffffffff, x0+1, x0+1, x0+1); FAIL; // __NR_flock 143 GO(__NR_flock, "2s 0m"); SY(__NR_flock, x0, x0); FAIL; // __NR_msync 144 GO(__NR_msync, "3s 1m"); SY(__NR_msync, x0, x0+1, x0); FAIL; // __NR_readv 145 GO(__NR_readv, "3s 1m"); SY(__NR_readv, x0, x0, x0+1); FAIL; // __NR_writev 146 GO(__NR_writev, "3s 1m"); SY(__NR_writev, x0, x0, x0+1); FAIL; // __NR_getsid 147 GO(__NR_getsid, "1s 0m"); SY(__NR_getsid, x0-1); FAIL; // __NR_fdatasync 148 GO(__NR_fdatasync, "1s 0m"); SY(__NR_fdatasync, x0-1); FAIL; // __NR__sysctl 149 GO(__NR__sysctl, "1s 1m"); SY(__NR__sysctl, x0); FAIL; // __NR_mlock 150 GO(__NR_mlock, "2s 0m"); SY(__NR_mlock, x0, x0+1); FAIL; // __NR_munlock 151 GO(__NR_munlock, "2s 0m"); SY(__NR_munlock, x0, x0+1); FAIL; // __NR_mlockall 152 GO(__NR_mlockall, "1s 0m"); SY(__NR_mlockall, x0-1); FAIL; // __NR_munlockall 153 GO(__NR_munlockall, "0s 0m"); SY(__NR_munlockall); SUCC_OR_FAILx(EPERM); // __NR_sched_setparam 154 GO(__NR_sched_setparam, "2s 1m"); SY(__NR_sched_setparam, x0, x0); FAIL; // __NR_sched_getparam 155 GO(__NR_sched_getparam, "2s 1m"); SY(__NR_sched_getparam, x0, x0); FAIL; // __NR_sched_setscheduler 156 GO(__NR_sched_setscheduler, "3s 1m"); SY(__NR_sched_setscheduler, x0-1, x0, x0+1); FAIL; // __NR_sched_getscheduler 157 GO(__NR_sched_getscheduler, "1s 0m"); SY(__NR_sched_getscheduler, x0-1); FAIL; // __NR_sched_yield 158 GO(__NR_sched_yield, "0s 0m"); SY(__NR_sched_yield); SUCC; // __NR_sched_get_priority_max 159 GO(__NR_sched_get_priority_max, "1s 0m"); SY(__NR_sched_get_priority_max, x0-1); FAIL; // __NR_sched_get_priority_min 160 GO(__NR_sched_get_priority_min, "1s 0m"); SY(__NR_sched_get_priority_min, x0-1); FAIL; // __NR_sched_rr_get_interval 161 GO(__NR_sched_rr_get_interval, "n/a"); //SY(__NR_sched_rr_get_interval); // (Not yet handled by Valgrind) FAIL; // __NR_nanosleep 162 GO(__NR_nanosleep, "2s 2m"); SY(__NR_nanosleep, x0, x0+1); FAIL; // __NR_mremap 163 GO(__NR_mremap, "5s 0m"); SY(__NR_mremap, x0+1, x0, x0, x0, x0); FAILx(EINVAL); // __NR_setresuid 164 GO(__NR_setresuid, "3s 0m"); SY(__NR_setresuid, x0, x0, x0); FAIL; // __NR_getresuid 165 GO(__NR_getresuid, "3s 3m"); SY(__NR_getresuid, x0, x0, x0); FAIL; // __NR_vm86 166 GO(__NR_vm86, "n/a"); // (will probably never be handled by Valgrind) // __NR_query_module 167 GO(__NR_query_module, "ni"); SY(__NR_query_module); FAIL; // __NR_poll 168 GO(__NR_poll, "3s 1m"); SY(__NR_poll, x0, x0+1, x0); FAIL; // __NR_nfsservctl 169 GO(__NR_nfsservctl, "n/a"); //SY(__NR_nfsservctl); // (Not yet handled by Valgrind) FAIL; // __NR_setresgid 170 GO(__NR_setresgid, "3s 0m"); SY(__NR_setresgid, x0, x0, x0); FAIL; // __NR_getresgid 171 GO(__NR_getresgid, "3s 3m"); SY(__NR_getresgid, x0, x0, x0); FAIL; // __NR_prctl 172 GO(__NR_prctl, "5s 0m"); SY(__NR_prctl, x0, x0, x0, x0, x0); FAIL; // __NR_rt_sigreturn 173 GO(__NR_rt_sigreturn, "n/a"); //SY(__NR_rt_sigreturn); // (Not yet handled by Valgrind) FAIL; // __NR_rt_sigaction 174 GO(__NR_rt_sigaction, "4s 4m"); SY(__NR_rt_sigaction, x0, x0+&px[2], x0+&px[2], x0); FAIL; // __NR_rt_sigprocmask 175 GO(__NR_rt_sigprocmask, "4s 2m"); SY(__NR_rt_sigprocmask, x0, x0+1, x0+1, x0); FAIL; // __NR_rt_sigpending 176 GO(__NR_rt_sigpending, "2s 1m"); SY(__NR_rt_sigpending, x0, x0+1); FAIL; // __NR_rt_sigtimedwait 177 GO(__NR_rt_sigtimedwait, "4s 3m"); SY(__NR_rt_sigtimedwait, x0+1, x0+1, x0+1, x0); FAIL; // __NR_rt_sigqueueinfo 178 GO(__NR_rt_sigqueueinfo, "3s 1m"); SY(__NR_rt_sigqueueinfo, x0, x0+1, x0); FAIL; // __NR_rt_sigsuspend 179 GO(__NR_rt_sigsuspend, "ignore"); // (I don't know how to test this...) // __NR_pread64 180 GO(__NR_pread64, "5s 1m"); SY(__NR_pread64, x0, x0, x0+1, x0, x0); FAIL; // __NR_pwrite64 181 GO(__NR_pwrite64, "5s 1m"); SY(__NR_pwrite64, x0, x0, x0+1, x0, x0); FAIL; // __NR_chown 182 GO(__NR_chown, "3s 1m"); SY(__NR_chown, x0, x0, x0); FAIL; // __NR_getcwd 183 GO(__NR_getcwd, "2s 1m"); SY(__NR_getcwd, x0, x0+1); FAIL; // __NR_capget 184 GO(__NR_capget, "2s 2m"); SY(__NR_capget, x0, x0); FAIL; // __NR_capset 185 GO(__NR_capset, "2s 2m"); SY(__NR_capset, x0, x0); FAIL; // __NR_sigaltstack 186 { struct our_sigaltstack { void *ss_sp; int ss_flags; size_t ss_size; } ss; ss.ss_sp = NULL; ss.ss_flags = 0; ss.ss_size = 0; VALGRIND_MAKE_MEM_NOACCESS(& ss, sizeof(struct our_sigaltstack)); GO(__NR_sigaltstack, "2s 2m"); SY(__NR_sigaltstack, x0+&ss, x0+&ss); SUCC; } // __NR_sendfile 187 GO(__NR_sendfile, "4s 1m"); SY(__NR_sendfile, x0, x0, x0+1, x0); FAIL; // __NR_getpmsg 188 // Could do 5s 4m with more effort, but I can't be bothered for this // crappy non-standard syscall. GO(__NR_getpmsg, "5s 0m"); SY(__NR_getpmsg, x0, x0, x0, x0); FAIL; // __NR_putpmsg 189 // Could do 5s 2m with more effort, but I can't be bothered for this
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -