// https://syzkaller.appspot.com/bug?id=84909969606053c6256d4b0541443dab936c198d // 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[53]; void loop() { memset(r, -1, sizeof(r)); r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfff000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); r[1] = syscall(__NR_socket, 0x2ul, 0x1ul, 0x0ul); memcpy((void*)0x2051fff3, "\x2f\x64\x65\x76\x2f\x6e\x65\x74\x2f\x74\x75\x6e\x00", 13); r[3] = syz_open_dev(0x2051fff3ul, 0x0ul, 0x0ul); r[4] = syscall(__NR_fcntl, r[3], 0x0ul, r[3]); memcpy((void*)0x20927fd8, "\x67\x72\x65\x30\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", 16); *(uint8_t*)0x20927fe8 = (uint8_t)0x73; *(uint8_t*)0x20927fe9 = (uint8_t)0x79; *(uint8_t*)0x20927fea = (uint8_t)0x7a; *(uint8_t*)0x20927feb = (uint8_t)0x30; *(uint8_t*)0x20927fec = (uint8_t)0x0; r[11] = syscall(__NR_ioctl, r[4], 0x400454caul, 0x20927fd8ul); memcpy((void*)0x2062ffe0, "\x67\x72\x65\x30\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", 16); *(uint16_t*)0x2062fff0 = (uint16_t)0x301; r[14] = syscall(__NR_ioctl, r[1], 0x8914ul, 0x2062ffe0ul); r[15] = syscall(__NR_socket, 0xaul, 0x802ul, 0x0ul); memcpy((void*)0x20f6e000, "\x00\x00\x00\x00\x00\x00\x0f\xa6", 8); r[17] = syscall(__NR_setsockopt, r[15], 0x29ul, 0x3bul, 0x20f6e000ul, 0x8ul); *(uint64_t*)0x20f5ffe0 = (uint64_t)0x0; *(uint64_t*)0x20f5ffe8 = (uint64_t)0x100000000000000; *(uint32_t*)0x20f5fff0 = (uint32_t)0x800; *(uint8_t*)0x20f5fff4 = (uint8_t)0x0; *(uint8_t*)0x20f5fff5 = (uint8_t)0xff; *(uint16_t*)0x20f5fff6 = (uint16_t)0x1; *(uint16_t*)0x20f5fff8 = (uint16_t)0x0; *(uint16_t*)0x20f5fffa = (uint16_t)0x0; *(uint32_t*)0x20f5fffc = (uint32_t)0x0; r[27] = syscall(__NR_setsockopt, r[15], 0x29ul, 0x20ul, 0x20f5ffe0ul, 0x20ul); *(uint32_t*)0x2089b000 = (uint32_t)0xffffffffffffffff; r[29] = syscall(__NR_setsockopt, r[15], 0x29ul, 0x21ul, 0x2089b000ul, 0x4ul); memcpy((void*)0x20ea0ff0, "\x65\x01\xd9\x03\x42\x7b\xa1\x04\x7c\x6d" "\xb3\x76\x00\x00\x06\x00", 16); r[31] = syscall(__NR_setsockopt, r[15], 0x29ul, 0x37ul, 0x20ea0ff0ul, 0x10ul); *(uint16_t*)0x20e0afe4 = (uint16_t)0xa; *(uint16_t*)0x20e0afe6 = (uint16_t)0x214e; *(uint32_t*)0x20e0afe8 = (uint32_t)0x800; *(uint8_t*)0x20e0afec = (uint8_t)0xfe; *(uint8_t*)0x20e0afed = (uint8_t)0x80; *(uint8_t*)0x20e0afee = (uint8_t)0x0; *(uint8_t*)0x20e0afef = (uint8_t)0x0; *(uint8_t*)0x20e0aff0 = (uint8_t)0x0; *(uint8_t*)0x20e0aff1 = (uint8_t)0x0; *(uint8_t*)0x20e0aff2 = (uint8_t)0x0; *(uint8_t*)0x20e0aff3 = (uint8_t)0x0; *(uint8_t*)0x20e0aff4 = (uint8_t)0x0; *(uint8_t*)0x20e0aff5 = (uint8_t)0x0; *(uint8_t*)0x20e0aff6 = (uint8_t)0x0; *(uint8_t*)0x20e0aff7 = (uint8_t)0x0; *(uint8_t*)0x20e0aff8 = (uint8_t)0x0; *(uint8_t*)0x20e0aff9 = (uint8_t)0x0; *(uint8_t*)0x20e0affa = (uint8_t)0x0; *(uint8_t*)0x20e0affb = (uint8_t)0xaa; *(uint32_t*)0x20e0affc = (uint32_t)0x0; r[52] = syscall(__NR_sendto, r[15], 0x2052bfccul, 0x0ul, 0x0ul, 0x20e0afe4ul, 0x1cul); } int main() { loop(); return 0; }