// https://syzkaller.appspot.com/bug?id=2b6a5e7ed9c189aadc974fc5ff168b131c005947 // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include static void test(); void loop() { while (1) { test(); } } long r[13]; void* thr(void* arg) { switch ((long)arg) { case 0: r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfff000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); break; case 1: memcpy((void*)0x20bddff7, "\x2f\x64\x65\x76\x2f\x6b\x76\x6d\x00", 9); r[2] = syscall(__NR_openat, 0xffffffffffffff9cul, 0x20bddff7ul, 0x40140ul, 0x0ul); break; case 2: r[3] = syscall(__NR_ioctl, r[2], 0xae01ul, 0x0ul); break; case 3: r[4] = syscall(__NR_ioctl, r[3], 0xae41ul, 0x1ul); break; case 4: r[5] = syscall(__NR_ioctl, r[4], 0xae80ul, 0x0ul); break; case 5: *(uint32_t*)0x20416fe0 = (uint32_t)0x8000000000000000; *(uint32_t*)0x20416fe4 = (uint32_t)0x2; *(uint64_t*)0x20416fe8 = (uint64_t)0x0; *(uint64_t*)0x20416ff0 = (uint64_t)0x2000; *(uint64_t*)0x20416ff8 = (uint64_t)0x205b3000; r[11] = syscall(__NR_ioctl, r[3], 0x4020ae46ul, 0x20416fe0ul); break; case 6: r[12] = syscall(__NR_ioctl, r[4], 0xae80ul, 0x0ul); break; } return 0; } void test() { long i; pthread_t th[14]; memset(r, -1, sizeof(r)); srand(getpid()); for (i = 0; i < 7; i++) { pthread_create(&th[i], 0, thr, (void*)i); usleep(rand() % 10000); } for (i = 0; i < 7; i++) { pthread_create(&th[7 + i], 0, thr, (void*)i); if (rand() % 2) usleep(rand() % 10000); } usleep(rand() % 100000); } int main() { int i; for (i = 0; i < 8; i++) { if (fork() == 0) { loop(); return 0; } } sleep(1000000); return 0; }