// https://syzkaller.appspot.com/bug?id=47608017d13c388bd2a2bc48d515536ff139230b // 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[80]; void loop() { memset(r, -1, sizeof(r)); r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfff000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); memcpy((void*)0x2091c000, "\x2f\x64\x65\x76\x2f\x73\x65\x71\x75\x65" "\x6e\x63\x65\x72\x32\x00", 16); r[2] = syscall(__NR_openat, 0xffffffffffffff9cul, 0x2091c000ul, 0x80003ul, 0x0ul); memcpy((void*)0x20539000, "\x2f\x64\x65\x76\x2f\x73\x6e\x64\x2f\x73\x65\x71\x00", 13); r[4] = syz_open_dev(0x20539000ul, 0x0ul, 0x0ul); *(uint8_t*)0x20a10000 = (uint8_t)0x10e; *(uint8_t*)0x20a10001 = (uint8_t)0x0; *(uint8_t*)0x20a10002 = (uint8_t)0xe; *(uint8_t*)0x20a10003 = (uint8_t)0x0; *(uint32_t*)0x20a10004 = (uint32_t)0x100; *(uint32_t*)0x20a10008 = (uint32_t)0x4000; *(uint8_t*)0x20a1000c = (uint8_t)0x0; *(uint8_t*)0x20a1000d = (uint8_t)0x0; *(uint8_t*)0x20a1000e = (uint8_t)0x0; *(uint8_t*)0x20a1000f = (uint8_t)0x0; *(uint8_t*)0x20a10010 = (uint8_t)0x0; *(uint8_t*)0x20a10011 = (uint8_t)0x0; *(uint8_t*)0x20a10012 = (uint8_t)0x0; *(uint8_t*)0x20a10013 = (uint8_t)0x0; *(uint8_t*)0x20a10014 = (uint8_t)0x0; *(uint8_t*)0x20a10015 = (uint8_t)0x0; *(uint8_t*)0x20a10016 = (uint8_t)0x0; *(uint8_t*)0x20a10017 = (uint8_t)0x0; *(uint8_t*)0x20a10018 = (uint8_t)0x0; *(uint8_t*)0x20a10019 = (uint8_t)0x0; *(uint8_t*)0x20a1001a = (uint8_t)0x0; *(uint8_t*)0x20a1001b = (uint8_t)0x0; *(uint8_t*)0x20a1001c = (uint8_t)0x0; *(uint8_t*)0x20a1001d = (uint8_t)0x0; *(uint8_t*)0x20a1001e = (uint8_t)0x0; *(uint8_t*)0x20a1001f = (uint8_t)0x0; *(uint8_t*)0x20a10020 = (uint8_t)0x0; *(uint8_t*)0x20a10021 = (uint8_t)0x0; *(uint8_t*)0x20a10022 = (uint8_t)0x0; *(uint8_t*)0x20a10023 = (uint8_t)0x0; *(uint8_t*)0x20a10024 = (uint8_t)0x0; *(uint8_t*)0x20a10025 = (uint8_t)0x0; *(uint8_t*)0x20a10026 = (uint8_t)0x0; *(uint8_t*)0x20a10027 = (uint8_t)0x0; *(uint8_t*)0x20a10028 = (uint8_t)0x0; *(uint8_t*)0x20a10029 = (uint8_t)0x0; *(uint8_t*)0x20a1002a = (uint8_t)0x0; *(uint8_t*)0x20a1002b = (uint8_t)0x0; *(uint8_t*)0x20a1002c = (uint8_t)0x0; *(uint8_t*)0x20a1002d = (uint8_t)0x0; *(uint8_t*)0x20a1002e = (uint8_t)0x0; *(uint8_t*)0x20a1002f = (uint8_t)0x0; *(uint8_t*)0x20a10030 = (uint8_t)0x0; *(uint8_t*)0x20a10031 = (uint8_t)0x0; *(uint8_t*)0x20a10032 = (uint8_t)0x0; *(uint8_t*)0x20a10033 = (uint8_t)0x0; *(uint8_t*)0x20a10034 = (uint8_t)0x0; *(uint8_t*)0x20a10035 = (uint8_t)0x0; *(uint8_t*)0x20a10036 = (uint8_t)0x0; *(uint8_t*)0x20a10037 = (uint8_t)0x0; *(uint8_t*)0x20a10038 = (uint8_t)0x0; *(uint8_t*)0x20a10039 = (uint8_t)0x0; *(uint8_t*)0x20a1003a = (uint8_t)0x0; *(uint8_t*)0x20a1003b = (uint8_t)0x0; *(uint8_t*)0x20a1003c = (uint8_t)0x0; *(uint8_t*)0x20a1003d = (uint8_t)0x0; *(uint8_t*)0x20a1003e = (uint8_t)0x0; *(uint8_t*)0x20a1003f = (uint8_t)0x0; *(uint8_t*)0x20a10040 = (uint8_t)0x0; *(uint8_t*)0x20a10041 = (uint8_t)0x0; *(uint8_t*)0x20a10042 = (uint8_t)0x0; *(uint8_t*)0x20a10043 = (uint8_t)0x0; *(uint8_t*)0x20a10044 = (uint8_t)0x0; *(uint8_t*)0x20a10045 = (uint8_t)0x0; *(uint8_t*)0x20a10046 = (uint8_t)0x0; *(uint8_t*)0x20a10047 = (uint8_t)0x0; *(uint8_t*)0x20a10048 = (uint8_t)0x0; *(uint8_t*)0x20a10049 = (uint8_t)0x0; *(uint8_t*)0x20a1004a = (uint8_t)0x0; *(uint8_t*)0x20a1004b = (uint8_t)0x0; *(uint8_t*)0x20a1004c = (uint8_t)0x0; *(uint8_t*)0x20a1004d = (uint8_t)0x0; *(uint8_t*)0x20a1004e = (uint8_t)0x0; *(uint8_t*)0x20a1004f = (uint8_t)0x0; r[79] = syscall(__NR_ioctl, r[4], 0x40505330ul, 0x20a10000ul); } int main() { loop(); return 0; }