// https://syzkaller.appspot.com/bug?id=bf154052f0eea4bc7712499e4569505907d15889 // 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); } } #ifndef __NR_memfd_create #define __NR_memfd_create 356 #endif #ifndef __NR_ioctl #define __NR_ioctl 54 #endif #ifndef __NR_mmap #define __NR_mmap 90 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 long r[22]; void loop() { memset(r, -1, sizeof(r)); r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfff000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); memcpy((void*)0x20fb6000, "\x2f\x64\x65\x76\x2f\x6c\x6f\x6f\x70\x23\x00", 11); r[2] = syz_open_dev(0x20fb6000ul, 0x0ul, 0x80080002ul); memcpy((void*)0x20d55ffd, "\x24\x27\x00", 3); r[4] = syscall(__NR_memfd_create, 0x20d55ffdul, 0x0ul); r[5] = syscall(__NR_ioctl, r[2], 0x4c00ul, r[4]); memcpy((void*)0x20000000, "\x2f\x64\x65\x76\x2f\x6c\x6f\x6f\x70\x23\x00", 11); r[7] = syz_open_dev(0x20000000ul, 0x0ul, 0x0ul); *(uint32_t*)0x20000000 = (uint32_t)0x0; *(uint32_t*)0x20000004 = (uint32_t)0x0; *(uint32_t*)0x20000008 = (uint32_t)0x0; *(uint32_t*)0x2000000c = (uint32_t)0x0; *(uint32_t*)0x20000010 = (uint32_t)0x0; *(uint32_t*)0x20000014 = (uint32_t)0x0; *(uint32_t*)0x20000018 = (uint32_t)0x0; *(uint32_t*)0x2000001c = (uint32_t)0xfffffffffffffffe; memcpy((void*)0x20000020, "\x21\xdb\xba\x96\x24\x54\x28\x1a\xc1\x4a\x7e\x86\x91\x0f\x46" "\x72\x51\x8a\xc2\x89\x90\x1e\x47\x2e\x1a\xad\xf2\x83\x33\xb7" "\xad\xf2\xe3\x2e\xb8\x7a\x81\x3c\xff\xff\xff\x07\x00\xff\xff" "\xfd\x75\x8a\xc0\x64\x9e\x0e\xba\x37\x3d\xa4\x80\x25\x4f\x8e" "\xc7\x00\x94\xac", 64); memcpy((void*)0x20000060, "\xf2\x31\x96\xfc\x66\x50\xfa\x74\x62\x6a" "\x57\xcb\xde\xfa\xff\x63\xc3\xd3\xdb\x8d" "\xbc\x9e\xd6\xd8\x5c\x84\xa7\xc1\x5c\x81" "\x3d\x8c", 32); *(uint32_t*)0x20000080 = (uint32_t)0x0; *(uint32_t*)0x20000084 = (uint32_t)0x0; *(uint32_t*)0x20000088 = (uint32_t)0x0; r[21] = syscall(__NR_ioctl, r[7], 0x4c02ul, 0x20000000ul); } int main() { loop(); return 0; }