1Common subdirectories: scrashme/.git and scrashme.new/.git 2diff --new-file --unified=5 scrashme/arm.h scrashme.new/arm.h 3--- scrashme/arm.h 1969-12-31 16:00:00.000000000 -0800 4+++ scrashme.new/arm.h 2011-03-21 14:43:40.000000000 -0700 5@@ -0,0 +1,4 @@ 6+#include "syscalls-arm.h" 7+ 8+#define KERNEL_ADDR 0xc0000000 9+ 10diff --new-file --unified=5 scrashme/sanitise.c scrashme.new/sanitise.c 11--- scrashme/sanitise.c 2010-03-18 04:45:47.000000000 -0700 12+++ scrashme.new/sanitise.c 2011-03-22 07:04:23.444767234 -0700 13@@ -21,10 +21,14 @@ 14 #endif 15 #ifdef __powerpc__ 16 #define PAGE_OFFSET 0xC0000000 17 #define TASK_SIZE (PAGE_OFFSET) 18 #endif 19+#ifdef __arm__ 20+#define PAGE_OFFSET 0xC0000000 21+#define TASK_SIZE (PAGE_OFFSET) 22+#endif 23 #ifdef __ia64__ 24 #define PAGE_OFFSET 0xe000000000000000 25 #define TASK_SIZE 0xa000000000000000 26 #endif 27 #ifdef __sparc__ 28diff --new-file --unified=5 scrashme/scrashme.c scrashme.new/scrashme.c 29--- scrashme/scrashme.c 2010-03-18 04:45:47.000000000 -0700 30+++ scrashme.new/scrashme.c 2011-03-22 07:04:54.584919926 -0700 31@@ -25,10 +25,13 @@ 32 #include "x86-64.h" 33 #endif 34 #ifdef __i386__ 35 #include "i386.h" 36 #endif 37+#ifdef __arm__ 38+#include "arm.h" 39+#endif 40 #ifdef __powerpc__ 41 #include "ppc.h" 42 #endif 43 #ifdef __ia64__ 44 #include "ia64.h" 45@@ -481,11 +484,13 @@ 46 } 47 (void)signal(SIGCHLD, SIG_IGN); 48 49 srand(seed); 50 51- chroot("tmp"); 52+ if (chroot("tmp")) { 53+ printf("chroot failed!\n"); 54+ } 55 } 56 57 static void run_mode(void) 58 { 59 int i; 60@@ -582,12 +587,16 @@ 61 syscalls = syscalls_ppc; 62 #elif __ia64__ 63 syscalls = syscalls_ia64; 64 #elif __sparc__ 65 syscalls = syscalls_sparc; 66-#else 67+#elif __i386__ 68 syscalls = syscalls_i386; 69+#elif __arm__ 70+ syscalls = syscalls_arm; 71+#else 72+#error Currently unsupported syscall architecture. 73 #endif 74 75 page_size = getpagesize(); 76 77 progname = argv[0]; 78diff --new-file --unified=5 scrashme/syscalls-arm.h scrashme.new/syscalls-arm.h 79--- scrashme/syscalls-arm.h 1969-12-31 16:00:00.000000000 -0800 80+++ scrashme.new/syscalls-arm.h 2011-03-22 10:29:47.995365865 -0700 81@@ -0,0 +1,373 @@ 82+/* Syscalls from arch/arm/kernel/call.S as of 2.6.32.26+drm33.12 */ 83+ 84+#include "scrashme.h" 85+#include "sanitise.h" 86+ 87+#define NR_SYSCALLS 364 88+struct syscalltable syscalls_arm[NR_SYSCALLS + 1] = { 89+/* 0 */ { .name = "restart_syscall" }, 90+ { .name = "exit", .flags = AVOID_SYSCALL }, 91+ { .name = "fork_wrapper", .flags = AVOID_SYSCALL }, 92+ { .name = "read", .sanitise = sanitise_read }, 93+ { .name = "write", .sanitise = sanitise_write }, 94+/* 5 */ { .name = "open" }, 95+ { .name = "close", .sanitise = sanitise_close }, 96+ { .name = "ni_syscall" }, /* was sys_waitpid */ 97+ { .name = "creat" }, 98+ { .name = "link" }, 99+/* 10 */ { .name = "unlink" }, 100+ { .name = "execve_wrapper" }, 101+ { .name = "chdir" }, 102+ { .name = "time", .flags = AVOID_SYSCALL }, /* used by libc4 */ 103+ { .name = "mknod" }, 104+/* 15 */ { .name = "chmod" }, 105+ { .name = "lchown16" }, 106+ { .name = "ni_syscall" }, /* was sys_break */ 107+ { .name = "ni_syscall" }, /* was sys_stat */ 108+ { .name = "lseek", .sanitise = sanitise_lseek }, 109+/* 20 */ { .name = "getpid" }, 110+ { .name = "mount" }, 111+ { .name = "oldumount", .flags = AVOID_SYSCALL }, /* used by libc4 */ 112+ { .name = "setuid16" }, 113+ { .name = "getuid16" }, 114+/* 25 */ { .name = "stime", .flags = AVOID_SYSCALL }, 115+ { .name = "ptrace" }, 116+ { .name = "alarm", .flags = AVOID_SYSCALL }, /* used by libc4 */ 117+ { .name = "ni_syscall" }, /* was sys_fstat */ 118+ { .name = "pause", .flags = AVOID_SYSCALL }, 119+/* 30 */ { .name = "utime", .flags = AVOID_SYSCALL }, /* used by libc4 */ 120+ { .name = "ni_syscall" }, /* was sys_stty */ 121+ { .name = "ni_syscall" }, /* was sys_getty */ 122+ { .name = "access" }, 123+ { .name = "nice" }, 124+/* 35 */ { .name = "ni_syscall" }, /* was sys_ftime */ 125+ { .name = "sync" }, 126+ { .name = "kill" }, 127+ { .name = "rename" }, 128+ { .name = "mkdir" }, 129+/* 40 */ { .name = "rmdir" }, 130+ { .name = "dup" }, 131+ { .name = "pipe" }, 132+ { .name = "times" }, 133+ { .name = "ni_syscall" }, /* was sys_prof */ 134+/* 45 */ { .name = "brk" }, 135+ { .name = "setgid16" }, 136+ { .name = "getgid16" }, 137+ { .name = "ni_syscall" }, /* was sys_signal */ 138+ { .name = "geteuid16" }, 139+/* 50 */ { .name = "getegid16" }, 140+ { .name = "acct" }, 141+ { .name = "umount" }, 142+ { .name = "ni_syscall" }, /* was sys_lock */ 143+ { .name = "ioctl", .sanitise = sanitise_ioctl }, 144+/* 55 */ { .name = "fcntl" }, 145+ { .name = "ni_syscall" }, /* was sys_mpx */ 146+ { .name = "setpgid" }, 147+ { .name = "ni_syscall" }, /* was sys_ulimit */ 148+ { .name = "ni_syscall" }, /* was sys_olduname */ 149+/* 60 */ { .name = "umask" }, 150+ { .name = "chroot" }, 151+ { .name = "ustat" }, 152+ { .name = "dup2" }, 153+ { .name = "getppid" }, 154+/* 65 */ { .name = "getpgrp" }, 155+ { .name = "setsid" }, 156+ { .name = "sigaction" }, 157+ { .name = "ni_syscall" }, /* was sys_sgetmask */ 158+ { .name = "ni_syscall" }, /* was sys_ssetmask */ 159+/* 70 */ { .name = "setreuid16" }, 160+ { .name = "setregid16" }, 161+ { .name = "sigsuspend", .flags = AVOID_SYSCALL }, 162+ { .name = "sigpending" }, 163+ { .name = "sethostname" }, 164+/* 75 */ { .name = "setrlimit" }, 165+ { .name = "old_getrlimit", .flags = AVOID_SYSCALL }, /* used by libc4 */ 166+ { .name = "getrusage" }, 167+ { .name = "gettimeofday" }, 168+ { .name = "settimeofday" }, 169+/* 80 */ { .name = "getgroups16" }, 170+ { .name = "setgroups16" }, 171+ { .name = "old_select", .flags = AVOID_SYSCALL }, 172+ { .name = "symlink" }, 173+ { .name = "ni_syscall" }, /* was sys_lstat */ 174+/* 85 */ { .name = "readlink" }, 175+ { .name = "uselib" }, 176+ { .name = "swapon" }, 177+ { .name = "reboot" }, 178+ { .name = "old_readdir", .flags = AVOID_SYSCALL }, /* used by libc4 */ 179+/* 90 */ { .name = "old_mmaap", .flags = AVOID_SYSCALL }, /* used by libc4 */ 180+ { .name = "munmap" }, 181+ { .name = "truncate" }, 182+ { .name = "ftruncate" }, 183+ { .name = "fchmod" }, 184+/* 95 */ { .name = "fchown16" }, 185+ { .name = "getpriority" }, 186+ { .name = "setpriority" }, 187+ { .name = "ni_syscall" }, /* was sys_profil */ 188+ { .name = "statfs" }, 189+/* 100 */ { .name = "fstatfs" }, 190+ { .name = "ni_syscall" }, /* sys_ioperm */ 191+ { .name = "sys_socketcall", .flags = AVOID_SYSCALL }, 192+ { .name = "syslog" }, 193+ { .name = "setitimer" }, 194+/* 105 */ { .name = "getitimer" }, 195+ { .name = "newstat" }, 196+ { .name = "newlstat" }, 197+ { .name = "newfstat", .sanitise = sanitise_newfstat }, 198+ { .name = "ni_syscall" }, /* was sys_uname */ 199+/* 110 */ { .name = "ni_syscall" }, /* was sys_iopl */ 200+ { .name = "vhangup" }, 201+ { .name = "ni_syscall" }, 202+ { .name = "syscall", .flags = AVOID_SYSCALL }, /* call a syscall */ 203+ { .name = "wait4" }, 204+/* 115 */ { .name = "swapoff" }, 205+ { .name = "sysinfo" }, 206+ { .name = "sys_ipc", .flags = AVOID_SYSCALL }, 207+ { .name = "fsync" }, 208+ { .name = "sigreturn_wrapper" }, 209+/* 120 */ { .name = "clone_wrapper", .flags = AVOID_SYSCALL }, 210+ { .name = "setdomainname" }, 211+ { .name = "newuname" }, 212+ { .name = "ni_syscall" }, /* modify_ldt */ 213+ { .name = "adjtimex" }, 214+/* 125 */ { .name = "mprotect", .sanitise = sanitise_mprotect }, 215+ { .name = "sigprocmask" }, 216+ { .name = "ni_syscall" }, /* was sys_create_module */ 217+ { .name = "init_module" }, 218+ { .name = "delete_module" }, 219+/* 130 */ { .name = "ni_syscall" }, /* was sys_get_kernel_syms */ 220+ { .name = "quotactl" }, 221+ { .name = "getpgid" }, 222+ { .name = "fchdir" }, 223+ { .name = "bdflush" }, 224+/* 135 */ { .name = "sysfs" }, 225+ { .name = "personality" }, 226+ { .name = "ni_syscall" }, /* reserved for afs_syscall */ 227+ { .name = "setfsuid16" }, 228+ { .name = "setfsgid16" }, 229+/* 140 */ { .name = "llseek" }, 230+ { .name = "getdents" }, 231+ { .name = "select", .flags = AVOID_SYSCALL }, 232+ { .name = "flock" }, 233+ { .name = "msync" }, 234+/* 145 */ { .name = "readv", .sanitise = sanitise_readv }, 235+ { .name = "writev", .sanitise = sanitise_writev }, 236+ { .name = "getsid" }, 237+ { .name = "fdatasync" }, 238+ { .name = "sysctl" }, 239+/* 150 */ { .name = "mlock" }, 240+ { .name = "munlock" }, 241+ { .name = "mlockall" }, 242+ { .name = "munlockall" }, 243+ { .name = "sched_setparam" }, 244+/* 155 */ { .name = "sched_getparam" }, 245+ { .name = "sched_setscheduler" }, 246+ { .name = "sched_getscheduler" }, 247+ { .name = "sched_yield" }, 248+ { .name = "sched_get_priority_max" }, 249+/* 160 */ { .name = "sched_get_priority_min" }, 250+ { .name = "sched_rr_get_interval" }, 251+ { .name = "nanosleep" }, 252+ { .name = "mremap", .sanitise = sanitise_mremap }, 253+ { .name = "setresuid16" }, 254+/* 165 */ { .name = "getresuid16" }, 255+ { .name = "ni_syscall" }, /* vm86 */ 256+ { .name = "ni_syscall" }, /* was sys_query_module */ 257+ { .name = "poll" }, 258+ { .name = "nfsservctl" }, 259+/* 170 */ { .name = "setresgid16" }, 260+ { .name = "getresgid16" }, 261+ { .name = "prctl" }, 262+ { .name = "rt_sigreturn_wrapper" }, 263+ { .name = "rt_sigaction", .sanitise = sanitise_rt_sigaction }, 264+/* 175 */ { .name = "rt_sigprocmask", .sanitise = sanitise_rt_sigprocmask }, 265+ { .name = "rt_sigpending" }, 266+ { .name = "rt_sigtimedwait" }, 267+ { .name = "rt_sigqueueinfo" }, 268+ { .name = "rt_sigsuspend", .flags = AVOID_SYSCALL }, 269+/* 180 */ { .name = "pread64", .sanitise = sanitise_pread64 }, 270+ { .name = "pwrite64", .sanitise = sanitise_pwrite64 }, 271+ { .name = "chown16" }, 272+ { .name = "getcwd" }, 273+ { .name = "capget" }, 274+/* 185 */ { .name = "capset" }, 275+ { .name = "sigaltstack_wrapper" }, 276+ { .name = "sendfile" }, 277+ { .name = "ni_syscall" }, /* getpmsg */ 278+ { .name = "ni_syscall" }, /* putpmsg */ 279+/* 190 */ { .name = "vfork_wrapper", .flags = AVOID_SYSCALL }, 280+ { .name = "getrlimit" }, 281+ { .name = "mmap2", .sanitise = sanitise_mmap }, 282+ { .name = "truncate64" }, 283+ { .name = "ftruncate64" }, 284+ /* 195 */ { .name = "stat64" }, 285+ { .name = "lstat64" }, 286+ { .name = "fstat64" }, 287+ { .name = "lchown" }, 288+ { .name = "getuid" }, 289+/* 200 */ { .name = "getgid" }, 290+ { .name = "geteuid" }, 291+ { .name = "getegid" }, 292+ { .name = "setreuid" }, 293+ { .name = "setregid" }, 294+/* 205 */ { .name = "getgroups" }, 295+ { .name = "setgroups" }, 296+ { .name = "fchown" }, 297+ { .name = "setresuid" }, 298+ { .name = "getresuid" }, 299+/* 210 */ { .name = "setresgid" }, 300+ { .name = "getresgid" }, 301+ { .name = "chown" }, 302+ { .name = "setuid" }, 303+ { .name = "setgid" }, 304+/* 215 */ { .name = "setfsuid" }, 305+ { .name = "setfsgid" }, 306+ { .name = "getdents64" }, 307+ { .name = "pivot_root", .flags = CAPABILITY_CHECK }, 308+ { .name = "mincore" }, 309+/* 220 */ { .name = "madvise" }, 310+ { .name = "fcntl64" }, 311+ { .name = "ni_syscall" }, /* TUX */ 312+ { .name = "ni_syscall" }, 313+ { .name = "gettid" }, 314+/* 225 */ { .name = "readahead" }, 315+ { .name = "setxattr" }, 316+ { .name = "lsetxattr" }, 317+ { .name = "fsetxattr" }, 318+ { .name = "getxattr" }, 319+/* 230 */ { .name = "lgetxattr" }, 320+ { .name = "fgetxattr" }, 321+ { .name = "listxattr" }, 322+ { .name = "llistxattr" }, 323+ { .name = "flistxattr" }, 324+/* 235 */ { .name = "removexattr" }, 325+ { .name = "lremovexattr" }, 326+ { .name = "fremovexattr" }, 327+ { .name = "tkill" }, 328+ { .name = "sendfile64" }, 329+/* 240 */ { .name = "futex" }, 330+ { .name = "sched_setaffinity" }, 331+ { .name = "sched_getaffinity" }, 332+ { .name = "io_setup" }, 333+ { .name = "io_destroy" }, 334+/* 245 */ { .name = "io_getevents" }, 335+ { .name = "io_submit" }, 336+ { .name = "io_cancel" }, 337+ { .name = "exit_group", .flags = AVOID_SYSCALL }, 338+ { .name = "lookup_dcookie", .flags = CAPABILITY_CHECK }, 339+/* 250 */ { .name = "epoll_create" }, 340+ { .name = "epoll_ctl" }, 341+ { .name = "_epoll_wait" }, 342+ { .name = "remap_file_pages" }, 343+ { .name = "ni_syscall" }, /* sys_set_thread_area */ 344+/* 255 */ { .name = "ni_syscall" }, /* sys_get_thread_area */ 345+ { .name = "set_tid_address" }, 346+ { .name = "timer_create" }, 347+ { .name = "timer_settime" }, 348+ { .name = "timer_gettime" }, 349+/* 260 */ { .name = "timer_getoverrun" }, 350+ { .name = "timer_delete" }, 351+ { .name = "clock_settime" }, 352+ { .name = "clock_gettime" }, 353+ { .name = "clock_getres" }, 354+/* 265 */ { .name = "clock_nanosleep" }, 355+ { .name = "statfs64_wrapper" }, 356+ { .name = "fstatfs64_wrapper" }, 357+ { .name = "tgkill" }, 358+ { .name = "utimes" }, 359+/* 270 */ { .name = "arm_fadvise64_64" }, 360+ { .name = "pciconfig_iobase" }, 361+ { .name = "pciconfig_read" }, 362+ { .name = "pciconfig_write" }, 363+ { .name = "mq_open" }, 364+/* 275 */ { .name = "mq_unlink" }, 365+ { .name = "mq_timedsend" }, 366+ { .name = "mq_timedreceive" }, 367+ { .name = "mq_notify" }, 368+ { .name = "mq_getsetattr" }, 369+/* 280 */ { .name = "waitid" }, 370+ { .name = "socket" }, 371+ { .name = "bind" }, 372+ { .name = "connect" }, 373+ { .name = "listen" }, 374+/* 285 */ { .name = "accept" }, 375+ { .name = "getsockname" }, 376+ { .name = "getpeername" }, 377+ { .name = "socketpair" }, 378+ { .name = "send" }, 379+/* 290 */ { .name = "sendto" }, 380+ { .name = "recv" }, 381+ { .name = "recvfrom" }, 382+ { .name = "shutdown" }, 383+ { .name = "setsockopt" }, 384+/* 295 */ { .name = "getsockopt" }, 385+ { .name = "sendmsg" }, 386+ { .name = "recvmsg" }, 387+ { .name = "semop" }, 388+ { .name = "semget" }, 389+/* 300 */ { .name = "semctl" }, 390+ { .name = "msgsnd" }, 391+ { .name = "msgrcv" }, 392+ { .name = "msgget" }, 393+ { .name = "msgctl" }, 394+/* 305 */ { .name = "shmat" }, 395+ { .name = "shmdt" }, 396+ { .name = "shmget" }, 397+ { .name = "shmctl" }, 398+ { .name = "add_key" }, 399+/* 310 */ { .name = "request_key" }, 400+ { .name = "keyctl" }, 401+ { .name = "semtimedop", }, 402+/* vserver */ { .name = "ni_syscall" }, 403+ { .name = "ioprio_set" }, 404+/* 315 */ { .name = "ioprio_get" }, 405+ { .name = "inotify_init" }, 406+ { .name = "inotify_add_watch" }, 407+ { .name = "inotify_rm_watch" }, 408+ { .name = "mbind" }, 409+/* 320 */ { .name = "get_mempolicy" }, 410+ { .name = "set_mempolicy" }, 411+ { .name = "openat" }, 412+ { .name = "mkdirat" }, 413+ { .name = "mknodat" }, 414+/* 325 */ { .name = "fchownat" }, 415+ { .name = "futimesat" }, 416+ { .name = "fstatat64" }, 417+ { .name = "unlinkat" }, 418+ { .name = "renameat" }, 419+/* 330 */ { .name = "linkat" }, 420+ { .name = "symlinkat" }, 421+ { .name = "readlinkat" }, 422+ { .name = "fchmodat" }, 423+ { .name = "faccessat" }, 424+/* 335 */ { .name = "pselect6" }, 425+ { .name = "ppoll" }, 426+ { .name = "unshare" }, 427+ { .name = "set_robust_list", .sanitise = sanitise_set_robust_list }, 428+ { .name = "get_robust_list" }, 429+/* 340 */ { .name = "splice", .sanitise = sanitise_splice }, 430+ { .name = "sync_file_range2", .sanitise = sanitise_sync_file_range }, 431+ { .name = "tee", .sanitise = sanitise_tee }, 432+ { .name = "vmsplice", .sanitise = sanitise_vmsplice }, 433+ { .name = "move_pages" }, 434+/* 345 */ { .name = "getcpu" }, 435+ { .name = "epoll_pwait" }, 436+ { .name = "kexec_load" }, 437+ { .name = "utimensat" }, 438+ { .name = "signalfd" }, 439+/* 350 */ { .name = "timerfd_create" }, 440+ { .name = "eventfd" }, 441+ { .name = "fallocate" }, 442+ { .name = "timerfd_settime" }, 443+ { .name = "timerfd_gettime" }, 444+/* 355 */ { .name = "signalfd4" }, 445+ { .name = "eventfd2" }, 446+ { .name = "epoll_create1" }, 447+ { .name = "dup3" }, 448+ { .name = "pipe2" }, 449+/* 360 */ { .name = "inotify_init1" }, 450+ { .name = "preadv" }, 451+ { .name = "pwritev" }, 452+ { .name = "rt_tgsigqueueinfo" }, 453+ { .name = "perf_event_open" }, 454+}; 455