// https://syzkaller.appspot.com/bug?id=a1800d4e325cef5607359e8c2ac9a103a316cd96 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); intptr_t res = 0; memcpy((void*)0x20000000, "./file0\000", 8); syscall(__NR_mkdir, /*path=*/0x20000000ul, /*mode=*/0ul); memcpy((void*)0x20000240, "./file0\000", 8); memcpy((void*)0x20000280, "tracefs\000", 8); syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x20000240ul, /*type=*/0x20000280ul, /*flags=*/0ul, /*data=*/0ul); memcpy((void*)0x20000000, "./file0\000", 8); res = syscall(__NR_open, /*file=*/0x20000000ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[0] = res; syscall(__NR_getdents64, /*fd=*/r[0], /*ent=*/0x20000300ul, /*count=*/0xd0ul); memcpy((void*)0x200000c0, "./file0\000", 8); memcpy((void*)0x20000100, "gid", 3); *(uint8_t*)0x20000103 = 0x3d; sprintf((char*)0x20000104, "0x%016llx", (long long)0); *(uint8_t*)0x20000116 = 0x2c; *(uint8_t*)0x20000117 = 0; syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x200000c0ul, /*type=*/0ul, /*flags=*/0x2204c3bul, /*opts=*/0x20000100ul); return 0; }