// https://syzkaller.appspot.com/bug?id=a743c25030c86d41c8b2cf6a0651603155c48245 // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include static uintptr_t syz_open_dev(uintptr_t a0, uintptr_t a1, uintptr_t 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)); buf[sizeof(buf) - 1] = 0; while ((hash = strchr(buf, '#'))) { *hash = '0' + (char)(a1 % 10); a1 /= 10; } return open(buf, a2, 0); } } long r[1]; void loop() { memset(r, -1, sizeof(r)); syscall(__NR_mmap, 0x20000000, 0xfff000, 3, 0x32, -1, 0); memcpy((void*)0x202a0000, "/dev/loop#", 11); r[0] = syz_open_dev(0x202a0000, 0x200000000004, 0x80); *(uint32_t*)0x20ed6000 = 0; *(uint32_t*)0x20ed6004 = 0; *(uint32_t*)0x20ed6008 = 0; *(uint32_t*)0x20ed600c = 0; *(uint32_t*)0x20ed6010 = 0x6361; *(uint32_t*)0x20ed6014 = 0xb; *(uint32_t*)0x20ed6018 = 0xfffffffa; *(uint32_t*)0x20ed601c = 1; memcpy((void*)0x20ed6020, "\x39\x9f\x23\x63\x1d\x00\x00\x00\x00\x00\x1a\x00\x5c\x69\x7b\xbc\x15" "\xf2\x32\xe3\xeb\xd7\xbe\xd6\x5f\x90\xb0\xe6\x33\x0e\xe7\x83\x1d\x19" "\xec\xf6\xaa\x04\xd5\x8d\x14\x43\x47\x44\x82\xe8\x50\x40\xe7\x49\x47" "\xeb\xb5\x08\x00\x00\x00\x00\x00\x00\x00\x30\xf3\xf3", 64); memcpy((void*)0x20ed6060, "\xd5\xa4\x30\x74\x60\x54\x00\x00\x00\x08\xb7\xb8" "\x15\x79\xf6\xa4\x1c\x01\xf7\xcf\xc1\x33\x22\x35" "\x82\xab\x86\x7d\xac\x76\x7b\xaf", 32); *(uint64_t*)0x20ed6080 = 0x26; *(uint64_t*)0x20ed6088 = 0; *(uint32_t*)0x20ed6090 = 0; syscall(__NR_ioctl, r[0], 0xc0481273, 0x20ed6000); } int main() { loop(); return 0; }