// https://syzkaller.appspot.com/bug?id=c85201ccbee00fd0b04f9239d1ec7bae8fa2e055 // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include static uintptr_t syz_open_pts(uintptr_t a0, uintptr_t a1) { int ptyno = 0; if (ioctl(a0, TIOCGPTN, &ptyno)) return -1; char buf[128]; sprintf(buf, "/dev/pts/%d", ptyno); return open(buf, a1, 0); } static void execute_one(); extern unsigned long long procid; void loop() { while (1) { execute_one(); } } uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; void execute_one() { long res = 0; memcpy((void*)0x20000100, "/dev/ptmx", 10); res = syscall(__NR_openat, 0xffffffffffffff9c, 0x20000100, 0x101c02, 0); if (res != -1) r[0] = res; memcpy((void*)0x20000080, "/dev/vga_arbiter", 17); res = syscall(__NR_openat, 0xffffffffffffff9c, 0x20000080, 0x2000, 0); if (res != -1) r[1] = res; *(uint32_t*)0x203b3fdc = 0; *(uint32_t*)0x203b3fe0 = 0; *(uint32_t*)0x203b3fe4 = 0; *(uint32_t*)0x203b3fe8 = 0; *(uint8_t*)0x203b3fec = 0; *(uint8_t*)0x203b3fed = 0; *(uint8_t*)0x203b3fee = 0; *(uint8_t*)0x203b3fef = 0; *(uint32_t*)0x203b3ff0 = 0; *(uint32_t*)0x203b3ff4 = 0; *(uint32_t*)0x203b3ff8 = 0; *(uint32_t*)0x203b3ffc = 0; syscall(__NR_ioctl, r[0], 0x40045431, 0x203b3fdc); syscall(__NR_write, r[0], 0x20000080, 0x100000272); syscall(__NR_ioctl, r[1], 0x80dc5521, 0x200002c0); res = syz_open_pts(r[0], 0xa00); if (res != -1) r[2] = res; *(uint32_t*)0x200000c0 = 0; *(uint32_t*)0x200000c4 = 0; *(uint32_t*)0x200000c8 = 0; *(uint32_t*)0x200000cc = 0; *(uint8_t*)0x200000d0 = 0; *(uint8_t*)0x200000d1 = 0; *(uint8_t*)0x200000d2 = 0; *(uint8_t*)0x200000d3 = 0; *(uint32_t*)0x200000d4 = 0; *(uint32_t*)0x200000d8 = 0; *(uint32_t*)0x200000dc = 0; *(uint32_t*)0x200000e0 = 0; syscall(__NR_ioctl, r[2], 0x5412, 0x200000c0); syscall(__NR_ioctl, r[0], 0x5411, 0x20000140); } int main() { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); for (;;) { loop(); } }