// 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[8]; void loop() { memset(r, -1, sizeof(r)); r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfff000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); r[1] = syscall(__NR_pipe2, 0x204fa000ul, 0x0ul); if (r[1] != -1) r[2] = *(uint32_t*)0x204fa004; memcpy((void*)0x20000000, "\x2f\x64\x65\x76\x2f\x73\x67\x23\x00", 9); r[4] = syz_open_dev(0x20000000ul, 0x0ul, 0x2ul); memcpy((void*)0x20df7000, "\xe4\xe0\x36\xe4\x6a\x12\xac\x48\x64\xf2\x15\xe7\x25\x8f\x71" "\x5f\x60\xff\x4f\x6e\xd7\x94\xda\x06\xc3\x51\xfb\xc0\x0f\xb9" "\x49\xf0\xdf\x1c\x23\xec\xc4\x4c\xd0\x9d\xa8\x68\xeb\x0d\xc7" "\xfe\x07\x73\x0a\xda\x45\xa1\xba\x27\xd7\x75\x36\x4d\x46\x90" "\x62\x1b\xaf\x2e\x09\x14\x6d\xe7\xf3\xa7\xf2\x86\x93\xde\x6d" "\x7f\xf0\x98\xee\xae\x36\x0e\x73\x6f\x48\x7e\xf0\xdd\xf9\x1a" "\xb8\xbf\x89\x00\xde\x70\x7e\x8d\xcd\x4b\xd9\x85\xe2\x9b\x8d" "\xc7\x9b\x39\xf5\x4d\xdb\x10\xb3\xcf\xe7\xab\x42\x64\x2c\x74" "\xc3\xea\x39\xf3\xe8\x14\x57\x6f\x27\xfc\xa9\x04\x07\xa5\xc4" "\xbf\xed\x81\xf8\xa9\xa5\x34\x41\x06\xe7\x7a", 146); r[6] = syscall(__NR_write, r[4], 0x20df7000ul, 0x92ul); r[7] = syscall(__NR_splice, r[4], 0x0ul, r[2], 0x0ul, 0x100000001ul, 0x0ul); } int main() { loop(); return 0; }