// https://syzkaller.appspot.com/bug?id=2892839f71ac929fe4e8039a20ca47cfda957c61 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include uint64_t r[1] = {0x0}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // shmget$private arguments: [ // key: const = 0x0 (8 bytes) // size: len = 0x4000 (8 bytes) // flags: shmget_flags = 0x100 (8 bytes) // unused: VMA[0x4000] // ] // returns ipc_shm res = syscall(__NR_shmget, /*key=*/0ul, /*size=*/0x4000ul, /*flags=*/0x100ul, /*unused=*/0x200000ffb000ul); if (res != -1) r[0] = res; // shmat arguments: [ // shmid: ipc_shm (resource) // addr: VMA[0x4000] // flags: shmat_flags = 0x7000 (8 bytes) // ] // returns shmaddr syscall(__NR_shmat, /*shmid=*/r[0], /*addr=*/0x200000ffc000ul, /*flags=SHM_REMAP|SHM_RDONLY|SHM_RND*/ 0x7000ul); // mlock arguments: [ // addr: VMA[0x2000] // size: len = 0x2000 (8 bytes) // ] syscall(__NR_mlock, /*addr=*/0x200000ffe000ul, /*size=*/0x2000ul); // munlock arguments: [ // addr: VMA[0x3000] // size: len = 0x3000 (8 bytes) // ] syscall(__NR_munlock, /*addr=*/0x200000ffd000ul, /*size=*/0x3000ul); return 0; }