// 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, 0x300000000004, 0x82); *(uint32_t*)0x20ed6000 = 0; *(uint32_t*)0x20ed6004 = 0; *(uint32_t*)0x20ed6008 = 0; *(uint32_t*)0x20ed600c = 0; *(uint32_t*)0x20ed6010 = 2; *(uint32_t*)0x20ed6014 = 0xb; *(uint32_t*)0x20ed6018 = 0xfffffffa; *(uint32_t*)0x20ed601c = 0x18; memcpy((void*)0x20ed6020, "\x39\x9f\x23\x63\x1d\x00\x00\x00\x00\x02\xf7\x00\x01\x00\x00\x00\x00" "\x00\x00\x00\xea\xf7\xb7\xd6\x5f\x90\xb0\xe6\x33\x0e\xe7\x39\xb3\x19" "\xd8\xf6\xaa\x6b\xd5\x8d\x14\x43\x47\x44\x82\xe8\x50\x40\xfb\x49\x47" "\x01\x00\x5b\x01\x01\x00\x00\x5b\xff\xff\x00\x01\xf3", 64); memcpy((void*)0x20ed6060, "\xcf\xa4\x30\x74\x5a\x54\x0d\xc1\xc1\x49\xb7\xb8" "\x15\x79\xf6\xa4\x1c\x51\xf7\xd5\x19\x33\x22\x3e" "\x82\xab\x86\x7d\xac\x76\x1f\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; }