// https://syzkaller.appspot.com/bug?id=71d2fc4ece61f7e21c3706cecf521a3df17d48ff // 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); } } static void test(); void loop() { while (1) { test(); } } long r[32]; void test() { memset(r, -1, sizeof(r)); r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfd3000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); *(uint32_t*)0x2002ef88 = (uint32_t)0x2; *(uint32_t*)0x2002ef8c = (uint32_t)0x78; *(uint8_t*)0x2002ef90 = (uint8_t)0x68; *(uint8_t*)0x2002ef91 = (uint8_t)0x2; *(uint8_t*)0x2002ef92 = (uint8_t)0x0; *(uint8_t*)0x2002ef93 = (uint8_t)0x0; *(uint32_t*)0x2002ef94 = (uint32_t)0x0; *(uint64_t*)0x2002ef98 = (uint64_t)0x80000; *(uint64_t*)0x2002efa0 = (uint64_t)0x0; *(uint64_t*)0x2002efa8 = (uint64_t)0x0; *(uint8_t*)0x2002efb0 = (uint8_t)0xfffffffffffffffc; *(uint8_t*)0x2002efb1 = (uint8_t)0x400000; *(uint8_t*)0x2002efb2 = (uint8_t)0x0; *(uint8_t*)0x2002efb3 = (uint8_t)0x0; *(uint32_t*)0x2002efb4 = (uint32_t)0x0; *(uint32_t*)0x2002efb8 = (uint32_t)0x0; *(uint32_t*)0x2002efbc = (uint32_t)0x0; *(uint64_t*)0x2002efc0 = (uint64_t)0x1; *(uint64_t*)0x2002efc8 = (uint64_t)0x0; *(uint64_t*)0x2002efd0 = (uint64_t)0x80000000000; *(uint64_t*)0x2002efd8 = (uint64_t)0x7ff; *(uint64_t*)0x2002efe0 = (uint64_t)0x0; *(uint32_t*)0x2002efe8 = (uint32_t)0x1; *(uint64_t*)0x2002eff0 = (uint64_t)0x0; *(uint32_t*)0x2002eff8 = (uint32_t)0x4000000000000; *(uint16_t*)0x2002effc = (uint16_t)0x0; *(uint16_t*)0x2002effe = (uint16_t)0x0; r[28] = syscall(__NR_perf_event_open, 0x2002ef88ul, 0x0ul, 0x0ul, 0xfffffffffffffffful, 0x0ul); memcpy((void*)0x20fd0ff7, "\x2f\x64\x65\x76\x2f\x73\x67\x23\x00", 9); r[30] = syz_open_dev(0x20fd0ff7ul, 0x0ul, 0x20000ul); r[31] = syscall(__NR_ioctl, r[30], 0x100000001ul, 0x20001000ul); } int main() { loop(); return 0; }