// https://syzkaller.appspot.com/bug?id=cc2051b93b1f08aa40c65b57cfed854557314d6c // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_seccomp #define __NR_seccomp 317 #endif uint64_t r[1] = {0xffffffffffffffff}; 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)) { } memcpy((void*)0x200000000040, "./file0\000", 8); syscall(__NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x200000000040ul, /*mode=S_IWOTH|S_IROTH|S_IXGRP*/ 0xeul); memcpy((void*)0x200000000340, "./file0\000", 8); memcpy((void*)0x200000000100, "./file0\000", 8); memcpy((void*)0x200000000000, "incremental-fs\000", 15); syscall(__NR_mount, /*src=*/0x200000000340ul, /*dst=*/0x200000000100ul, /*type=*/0x200000000000ul, /*flags=*/0ul, /*opts=*/0ul); memcpy((void*)0x2000000000c0, "/dev/zero\000", 10); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x2000000000c0ul, /*flags=O_CLOEXEC|O_RDWR*/ 0x80002, /*mode=*/0); if (res != -1) r[0] = res; syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x200000ul, /*prot=PROT_GROWSDOWN|PROT_SEM|PROT_WRITE|PROT_EXEC*/ 0x100000eul, /*flags=MAP_FIXED|MAP_PRIVATE*/ 0x12ul, /*fd=*/r[0], /*offset=*/0x343e2000ul); *(uint16_t*)0x200000000240 = 0; *(uint64_t*)0x200000000248 = 0; syscall(__NR_seccomp, /*op=*/1ul, /*flags=*/7ul, /*arg=*/0x200000000240ul); syscall(__NR_madvise, /*addr=*/0x200000000000ul, /*len=*/0xc00000ul, /*advice=MADV_COLLAPSE*/ 0x19ul); return 0; }