// https://syzkaller.appspot.com/bug?id=b7640dae2467568f05425b289a1f004faa2dc292 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include uint64_t r[2] = {0xffffffffffffffff, 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); intptr_t res = 0; memcpy((void*)0x20000000, "/dev/vhost-net\000", 15); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x20000000ul, /*flags=*/2ul, /*mode=*/0ul); if (res != -1) r[0] = res; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0xaf01, /*v=*/0ul); memcpy((void*)0x20000100, "./file0\000", 8); res = syscall( __NR_creat, /*file=*/0x20000100ul, /*mode=S_IXOTH|S_IWOTH|S_IRGRP|S_IXUSR|S_IWUSR|0xd931d3864d39dc00*/ 0xd931d3864d39dce3ul); if (res != -1) r[1] = res; memcpy((void*)0x20002340, "\x7f\x45\x4c\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03" "\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x00\x00\x00\x00" "\x00\x00\x00\x19\x1b\xda\x00\x00\x20\x00\x01\x00\x00\x00\x00\x02\x80" "\x00\x00\x00\x00\x00\x03", 57); sprintf((char*)0x20002379, "%023llo", (long long)-1); *(uint64_t*)0x20002390 = r[1]; *(uint64_t*)0x20002398 = -1; syscall(__NR_write, /*fd=*/r[1], /*data=*/0x20002340ul, /*len=*/0x69ul); syscall(__NR_close, /*fd=*/r[1]); memcpy((void*)0x20000180, "./file0\000", 8); syscall(__NR_execve, /*file=*/0x20000180ul, /*argv=*/0ul, /*envp=*/0ul); return 0; }