// https://syzkaller.appspot.com/bug?id=8f063539d4ecf1faf3132624b57a641e923ee25a // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include static long syz_open_dev(long a0, long a1, long a2) { if (a0 == 0xc || a0 == 0xb) { char buf[128]; sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1, (uint8_t)a2); return open(buf, O_RDWR, 0); } else { char buf[1024]; char* hash; strncpy(buf, (char*)a0, sizeof(buf) - 1); buf[sizeof(buf) - 1] = 0; while ((hash = strchr(buf, '#'))) { *hash = '0' + (char)(a1 % 10); a1 /= 10; } return open(buf, a2, 0); } } uint64_t r[4] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0x0}; int main(void) { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); long res = 0; memcpy((void*)0x20000000, "/dev/kvm", 9); res = syscall(__NR_openat, 0xffffffffffffff9c, 0x20000000, 0, 0); if (res != -1) r[0] = res; res = syscall(__NR_ioctl, r[0], 0xae01, 0); if (res != -1) r[1] = res; res = syscall(__NR_ioctl, r[1], 0xae41, 0); if (res != -1) r[2] = res; memcpy((void*)0x20000100, "\x01\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x40\x00\x00\x02\xff\x0f", 17); syscall(__NR_ioctl, r[2], 0x4080aebf, 0x20000100); syscall(__NR_mmap, 0x20000000, 0x4000, 0, 0x32, -1, 0); memcpy((void*)0x20000140, "/dev/dsp#", 10); syz_open_dev(0x20000140, 1, 2); *(uint16_t*)0x200001c0 = 0xa; *(uint16_t*)0x200001c2 = htobe16(0); *(uint32_t*)0x200001c4 = 5; *(uint8_t*)0x200001c8 = 0xfe; *(uint8_t*)0x200001c9 = 0x80; *(uint8_t*)0x200001ca = 0; *(uint8_t*)0x200001cb = 0; *(uint8_t*)0x200001cc = 0; *(uint8_t*)0x200001cd = 0; *(uint8_t*)0x200001ce = 0; *(uint8_t*)0x200001cf = 0; *(uint8_t*)0x200001d0 = 0; *(uint8_t*)0x200001d1 = 0; *(uint8_t*)0x200001d2 = 0; *(uint8_t*)0x200001d3 = 0; *(uint8_t*)0x200001d4 = 0; *(uint8_t*)0x200001d5 = 0; *(uint8_t*)0x200001d6 = 0; *(uint8_t*)0x200001d7 = 0xaa; *(uint32_t*)0x200001d8 = 4; syscall(__NR_connect, -1, 0x200001c0, 0xfffffffffffffe98); *(uint32_t*)0x200002c0 = 2; syscall(__NR_setsockopt, -1, 0x29, 1, 0x200002c0, 4); *(uint64_t*)0x20000000 = 0; *(uint32_t*)0x20000008 = 0; *(uint64_t*)0x20000010 = 0x20017000; *(uint64_t*)0x20017000 = 0x20004000; *(uint64_t*)0x20017008 = 0; *(uint64_t*)0x20000018 = 1; *(uint64_t*)0x20000020 = 0; *(uint64_t*)0x20000028 = 0; *(uint32_t*)0x20000030 = 0; syscall(__NR_sendmsg, -1, 0x20000000, 0); res = syscall(__NR_getpid); if (res != -1) r[3] = res; syscall(__NR_ioprio_get, 3, r[3]); *(uint32_t*)0x20000200 = 0; syscall(__NR_sched_setscheduler, r[3], 5, 0x20000200); *(uint64_t*)0x20001380 = 0x20000180; *(uint64_t*)0x20001388 = 0x13d; syscall(__NR_preadv, -1, 0x20001380, 1, 0); syscall(__NR_gettid); return 0; }