// https://syzkaller.appspot.com/bug?id=34609cfe6372880778d0c8d170ba5dc2ffd99741 // 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(volatile long a0, volatile long a1, volatile 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[2] = {0xffffffffffffffff, 0x0}; int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); intptr_t res = 0; res = -1; res = syz_open_dev(0xc, 2, 0x14); if (res != -1) r[0] = res; res = syscall(__NR_io_setup, 0xe, 0x20000000ul); if (res != -1) r[1] = *(uint64_t*)0x20000000; *(uint32_t*)0x20000240 = 0x15; syscall(__NR_ioctl, r[0], 0x5423, 0x20000240ul); *(uint64_t*)0x200001c0 = 0x20000180; *(uint64_t*)0x20000180 = 0; *(uint32_t*)0x20000188 = 0; *(uint32_t*)0x2000018c = 0; *(uint16_t*)0x20000190 = 1; *(uint16_t*)0x20000192 = 0; *(uint32_t*)0x20000194 = r[0]; *(uint64_t*)0x20000198 = 0; *(uint64_t*)0x200001a0 = 0; *(uint64_t*)0x200001a8 = 0; *(uint64_t*)0x200001b0 = 0; *(uint32_t*)0x200001b8 = 0; *(uint32_t*)0x200001bc = -1; syscall(__NR_io_submit, r[1], 1ul, 0x200001c0ul); return 0; }