// https://syzkaller.appspot.com/bug?id=4462682cd32aee8ff03a43c8b9be3963743bc506 // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #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[22]; void loop() { memset(r, -1, sizeof(r)); r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfff000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); memcpy((void*)0x2002a000, "\x2f\x64\x65\x76\x2f\x73\x67\x23\x00", 9); r[2] = syz_open_dev(0x2002a000ul, 0x0ul, 0x142ul); memcpy((void*)0x20016f2f, "\xae\x68\xb4\x1f\xaf\x67\x33\xc7\x68\xd9\xc7\x7d\x27\x4a\xb3" "\xd6\x7d\xba\xa0\x10\x44\xc0\xd2\x66\x18\x82\x9a\x68\xb0\x1b" "\x6e\x8d\xec\xa9\x3b\x15\x9d\x00\xb4\x42\x48\x6f\x36\x2b\x69" "\x6d\x4a\x1d\x3b\x24\x76\x08\x8d\xbc\xbf\xae\x2b\x59\x28\x39" "\x71\x77\x5e\x7b\xfe\x1a\x71\x83\xbd\xb4\x45\x2a\x9c\xc9\x51" "\x85\x13\x48\x92\x51\x16\x42\x2e\x2c\x04\xeb\x79\xb4", 88); r[4] = syscall(__NR_write, r[2], 0x20016f2ful, 0x58ul); *(uint64_t*)0x205f2f80 = (uint64_t)0x200c1000; *(uint64_t*)0x205f2f88 = (uint64_t)0xcc; *(uint64_t*)0x205f2f90 = (uint64_t)0x200cef63; *(uint64_t*)0x205f2f98 = (uint64_t)0x0; *(uint64_t*)0x205f2fa0 = (uint64_t)0x20111000; *(uint64_t*)0x205f2fa8 = (uint64_t)0x0; *(uint64_t*)0x205f2fb0 = (uint64_t)0x20a43fcf; *(uint64_t*)0x205f2fb8 = (uint64_t)0x0; *(uint64_t*)0x205f2fc0 = (uint64_t)0x20654000; *(uint64_t*)0x205f2fc8 = (uint64_t)0x0; *(uint64_t*)0x205f2fd0 = (uint64_t)0x201b0fc8; *(uint64_t*)0x205f2fd8 = (uint64_t)0x0; *(uint64_t*)0x205f2fe0 = (uint64_t)0x206e2f6c; *(uint64_t*)0x205f2fe8 = (uint64_t)0x0; *(uint64_t*)0x205f2ff0 = (uint64_t)0x20327fe7; *(uint64_t*)0x205f2ff8 = (uint64_t)0x0; r[21] = syscall(__NR_readv, r[2], 0x205f2f80ul, 0x8ul); } int main() { loop(); return 0; }