// https://syzkaller.appspot.com/bug?id=6ebdcf8b382e79788943bc3292640283d68fba29 // 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[20]; void test() { memset(r, -1, sizeof(r)); r[0] = syscall(__NR_mmap, 0x20003000ul, 0xfce000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); memcpy((void*)0x20fcbff3, "\x2f\x64\x65\x76\x2f\x6e\x65\x74\x2f\x74\x75\x6e\x00", 13); r[2] = syz_open_dev(0x20fcbff3ul, 0x0ul, 0x20000107ul); memcpy((void*)0x20574000, "\x0a\x00\x00\x00\x15\x01\x00\x00\x00\x00\x00\x00\x00\xb7\x19" "\x00", 16); *(uint16_t*)0x20574010 = (uint16_t)0x1; *(uint8_t*)0x20574012 = (uint8_t)0xbb; *(uint8_t*)0x20574013 = (uint8_t)0xbb; *(uint8_t*)0x20574014 = (uint8_t)0xbb; *(uint8_t*)0x20574015 = (uint8_t)0xbb; *(uint8_t*)0x20574016 = (uint8_t)0xbb; *(uint8_t*)0x20574017 = (uint8_t)0x0; *(uint8_t*)0x20574018 = (uint8_t)0x0; *(uint8_t*)0x20574019 = (uint8_t)0x0; *(uint8_t*)0x2057401a = (uint8_t)0x0; *(uint8_t*)0x2057401b = (uint8_t)0x0; *(uint8_t*)0x2057401c = (uint8_t)0x0; *(uint8_t*)0x2057401d = (uint8_t)0x0; *(uint8_t*)0x2057401e = (uint8_t)0x0; *(uint8_t*)0x2057401f = (uint8_t)0x0; r[19] = syscall(__NR_ioctl, r[2], 0x400454caul, 0x20574000ul); } int main() { loop(); return 0; }