// https://syzkaller.appspot.com/bug?id=e5aec54f6af0730f1ebfb6fbf4e53409ae0a5c87 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include static long syz_open_dev(volatile long a0, volatile long a1, volatile long 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) - 1); buf[sizeof(buf) - 1] = 0; while ((hash = strchr(buf, '#'))) { *hash = '0' + (char)(a1 % 10); a1 /= 10; } return open(buf, a2, 0); } } uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); intptr_t res = 0; memcpy((void*)0x20000000, "/dev/video#\000", 12); res = -1; res = syz_open_dev(0x20000000, 0, 2); if (res != -1) r[0] = res; *(uint32_t*)0x20000080 = 5; *(uint32_t*)0x20000084 = 1; *(uint32_t*)0x20000088 = 4; *(uint32_t*)0x2000008c = 0; *(uint8_t*)0x20000090 = 0; memset((void*)0x20000091, 0, 3); syscall(__NR_ioctl, r[0], 0xc0145608, 0x20000080ul); *(uint32_t*)0x200000c0 = 0; *(uint32_t*)0x200000c4 = 7; *(uint32_t*)0x200000c8 = 1; *(uint32_t*)0x200000d0 = 1; *(uint16_t*)0x200000d8 = 9; *(uint16_t*)0x200000da = 0; *(uint16_t*)0x200000dc = 5; *(uint16_t*)0x200000de = 0x69; *(uint16_t*)0x200000e0 = 0x722; *(uint16_t*)0x200000e2 = 0xff01; *(uint16_t*)0x200000e4 = 1; *(uint16_t*)0x200000e6 = 0x1e30; *(uint16_t*)0x200000e8 = 0xff; *(uint16_t*)0x200000ea = -1; *(uint16_t*)0x200000ec = 3; *(uint16_t*)0x200000ee = 0x200; *(uint16_t*)0x200000f0 = 9; *(uint16_t*)0x200000f2 = 0x401; *(uint16_t*)0x200000f4 = 0xfc01; *(uint16_t*)0x200000f6 = 3; *(uint16_t*)0x200000f8 = 5; *(uint16_t*)0x200000fa = 0x4726; *(uint16_t*)0x200000fc = 0xffc0; *(uint16_t*)0x200000fe = 8; *(uint16_t*)0x20000100 = 4; *(uint16_t*)0x20000102 = 0x401; *(uint16_t*)0x20000104 = 3; *(uint16_t*)0x20000106 = 0x401; *(uint16_t*)0x20000108 = 8; *(uint16_t*)0x2000010a = 2; *(uint16_t*)0x2000010c = 0x400; *(uint16_t*)0x2000010e = 0x865; *(uint16_t*)0x20000110 = 0xfb; *(uint16_t*)0x20000112 = 3; *(uint16_t*)0x20000114 = 2; *(uint16_t*)0x20000116 = 0x27; *(uint16_t*)0x20000118 = 7; *(uint16_t*)0x2000011a = 0; *(uint16_t*)0x2000011c = 0; *(uint16_t*)0x2000011e = 0xf000; *(uint16_t*)0x20000120 = 2; *(uint16_t*)0x20000122 = 8; *(uint16_t*)0x20000124 = 0xff12; *(uint16_t*)0x20000126 = 0x40; *(uint16_t*)0x20000128 = -1; *(uint16_t*)0x2000012a = 1; *(uint16_t*)0x2000012c = 0x37; *(uint16_t*)0x2000012e = 9; *(uint16_t*)0x20000130 = 7; *(uint16_t*)0x20000132 = 9; *(uint16_t*)0x20000134 = 0xc0; *(uint16_t*)0x20000136 = 1; *(uint16_t*)0x20000138 = 9; *(uint32_t*)0x2000013c = 0; memset((void*)0x20000140, 0, 8); *(uint32_t*)0x200001a0 = 0x800; memset((void*)0x200001a4, 0, 28); syscall(__NR_ioctl, r[0], 0xc100565c, 0x200000c0ul); return 0; }