diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-11-23 08:51:04 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-11-23 08:51:04 +0100 |
| commit | 7061d1973b6243565cfac50a853543fdffb5a073 (patch) | |
| tree | 1b9e32d1cd5d7fd8a1b6b8a62b444d7a26492320 /executor | |
| parent | 31af2ce0225268bd9d1ed27fef830debbed2a188 (diff) | |
sys/syz-extract: fix mmap on arm
__NR_mmap is missing on arm entirely,
so we disable mmap during generate.
Patch mmap to mmap2 right in syz-extract,
so that mmap is never missing.
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/executor_linux.cc | 10 | ||||
| -rw-r--r-- | executor/syscalls_linux.h | 9 |
2 files changed, 5 insertions, 14 deletions
diff --git a/executor/executor_linux.cc b/executor/executor_linux.cc index 14eba3ae8..8b38dbf21 100644 --- a/executor/executor_linux.cc +++ b/executor/executor_linux.cc @@ -72,16 +72,6 @@ int main(int argc, char** argv) install_segv_handler(); use_temporary_dir(); -#if defined(__i386__) || defined(__arm__) - // mmap syscall on i386/arm is translated to old_mmap and has different signature. - // As a workaround fix it up to mmap2, which has signature that we expect. - // pkg/csource has the same hack. - for (size_t i = 0; i < sizeof(syscalls) / sizeof(syscalls[0]); i++) { - if (strcmp(syscalls[i].name, "mmap") == 0) - syscalls[i].sys_nr = __NR_mmap2; - } -#endif - int pid = -1; switch (flag_sandbox) { case sandbox_none: diff --git a/executor/syscalls_linux.h b/executor/syscalls_linux.h index e27cfa979..b699cb351 100644 --- a/executor/syscalls_linux.h +++ b/executor/syscalls_linux.h @@ -2,7 +2,7 @@ #if defined(__i386__) || 0 #define GOARCH "386" -#define SYZ_REVISION "4fe4a655475beb6e3a3ba300d55a7a7a050a5015" +#define SYZ_REVISION "bcbb2cfb0201255ca22ecc77ebc8e22d4880e9a5" #define __NR_syz_emit_ethernet 1000000 #define __NR_syz_extract_tcp_res 1000001 #define __NR_syz_fuse_mount 1000002 @@ -903,7 +903,7 @@ call_t syscalls[] = { {"mlock", 150}, {"mlock2", 376}, {"mlockall", 152}, - {"mmap", 90}, + {"mmap", 192}, {"modify_ldt$read", 123}, {"modify_ldt$read_default", 123}, {"modify_ldt$write", 123}, @@ -3071,7 +3071,7 @@ call_t syscalls[] = { #if defined(__arm__) || 0 #define GOARCH "arm" -#define SYZ_REVISION "3e7d2170660743d0c6a2fd6e85bb1f47c07c1de9" +#define SYZ_REVISION "535d8ff089248a1f2cb7f41725f543f14767dd1e" #define __NR_syz_emit_ethernet 1000000 #define __NR_syz_extract_tcp_res 1000001 #define __NR_syz_fuse_mount 1000002 @@ -3081,7 +3081,7 @@ call_t syscalls[] = { #define __NR_syz_open_pts 1000006 #define __NR_syz_test 1000007 -unsigned syscall_count = 1495; +unsigned syscall_count = 1496; call_t syscalls[] = { {"accept", 285}, {"accept$alg", 285}, @@ -3952,6 +3952,7 @@ call_t syscalls[] = { {"mlock", 150}, {"mlock2", 390}, {"mlockall", 152}, + {"mmap", 192}, {"mount", 21}, {"move_pages", 344}, {"mprotect", 125}, |
