// https://syzkaller.appspot.com/bug?id=d9954158f07957a488b97187b80eb1ed2e2698c9 // 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[4]; void* thr(void* arg) { switch ((long)arg) { case 0: r[0] = syscall(__NR_mmap, 0x2092d000ul, 0x400000ul, 0x80000002ul, 0x8972ul, 0xfffffffffffffffful, 0x0ul); break; case 1: r[1] = syscall(__NR_mremap, 0x20ba3000ul, 0x3000ul, 0x2000ul, 0x3ul, 0x20b45000ul); break; case 2: r[2] = syscall(__NR_madvise, 0x2092d000ul, 0x400000ul, 0x10200000008ul); break; case 3: r[3] = syscall(__NR_madvise, 0x2092d000ul, 0x400000ul, 0x4ul); break; } return 0; } void test() { long i; pthread_t th[8]; memset(r, -1, sizeof(r)); for (i = 0; i < 4; i++) { pthread_create(&th[i], 0, thr, (void*)i); 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; }