// https://syzkaller.appspot.com/bug?id=d2b2c2af3a121678871fc363fca6d223fbdfe634 // 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=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-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*)0x20000000, "./file0\000", 8); syscall(__NR_mkdir, /*path=*/0x20000000ul, /*mode=*/0ul); memcpy((void*)0x20000340, "./file1\000", 8); syscall(__NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x20000340ul, /*mode=*/0ul); memcpy((void*)0x200004c0, "./bus\000", 6); syscall(__NR_mkdir, /*path=*/0x200004c0ul, /*mode=*/0ul); memcpy((void*)0x200000c0, "./bus\000", 6); memcpy((void*)0x20000080, "overlay\000", 8); memcpy((void*)0x20000400, "workdir", 7); *(uint8_t*)0x20000407 = 0x3d; memcpy((void*)0x20000408, "./bus", 5); *(uint8_t*)0x2000040d = 0x2c; memcpy((void*)0x2000040e, "lowerdir", 8); *(uint8_t*)0x20000416 = 0x3d; memcpy((void*)0x20000417, "./file0", 7); *(uint8_t*)0x2000041e = 0x2c; memcpy((void*)0x2000041f, "upperdir", 8); *(uint8_t*)0x20000427 = 0x3d; memcpy((void*)0x20000428, "./file1", 7); *(uint8_t*)0x2000042f = 0x2c; memcpy((void*)0x20000430, "metacopy=on", 11); *(uint8_t*)0x2000043b = 0x2c; *(uint8_t*)0x2000043c = 0; syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x200000c0ul, /*type=*/0x20000080ul, /*flags=*/0ul, /*opts=*/0x20000400ul); memcpy((void*)0x20000000, "./bus\000", 6); memcpy((void*)0x20000040, "./bus\000", 6); memcpy((void*)0x200000c0, "incremental-fs\000", 15); syscall(__NR_mount, /*src=*/0x20000000ul, /*dst=*/0x20000040ul, /*type=*/0x200000c0ul, /*flags=*/0ul, /*opts=*/0ul); memcpy((void*)0x20000140, "./file0\000", 8); res = syscall(__NR_open, /*file=*/0x20000140ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[0] = res; memcpy((void*)0x20001600, "./file1\000", 8); syscall(__NR_mknodat, /*dirfd=*/r[0], /*file=*/0x20001600ul, /*mode=*/0ul, /*dev=*/0x700); memcpy((void*)0x20000140, "./bus\000", 6); syscall(__NR_chdir, /*dir=*/0x20000140ul); memcpy((void*)0x20000200, "./file1\000", 8); memcpy((void*)0x20000300, "./bus\000", 6); syscall(__NR_link, /*old=*/0x20000200ul, /*new=*/0x20000300ul); memcpy((void*)0x20000100, "./bus\000", 6); syscall(__NR_creat, /*file=*/0x20000100ul, /*mode=*/0ul); return 0; }