// https://syzkaller.appspot.com/bug?id=81a8305cd101438de3770cd5fb625389bc9a4df9 // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #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[12]; void loop() { memset(r, -1, sizeof(r)); r[0] = syscall(__NR_mmap, 0x20001000ul, 0xffe000ul, 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*)0x20a84000, "\x67\x72\x65\x30\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00", 16); memcpy((void*)0x20a84010, "\xca\x4f\x73\x4f\x7f\x35\x52\x6c\xe9\x0e" "\x00\x00\xff\xff\xee\x00", 16); r[7] = syscall(__NR_ioctl, r[4], 0x400454caul, 0x20a84000ul); 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[10] = syscall(__NR_ioctl, r[1], 0x8914ul, 0x2062ffe0ul); r[11] = syscall(__NR_read, r[3], 0x20838000ul, 0xeul); } int main() { loop(); return 0; }