// https://syzkaller.appspot.com/bug?id=abb6cc54bd2802dfdeb0978f7adf870325b80f92 // 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(); } } #ifndef __NR_bpf #define __NR_bpf 321 #endif long r[32]; void* thr(void* arg) { switch ((long)arg) { case 0: r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfbd000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); break; case 1: *(uint32_t*)0x20ed1000 = (uint32_t)0x6; *(uint32_t*)0x20ed1004 = (uint32_t)0x4; *(uint32_t*)0x20ed1008 = (uint32_t)0x9; *(uint32_t*)0x20ed100c = (uint32_t)0x4000062; *(uint32_t*)0x20ed1010 = (uint32_t)0x200000000000; *(uint32_t*)0x20ed1014 = (uint32_t)0xffffffffffffffff; *(uint32_t*)0x20ed1018 = (uint32_t)0x0; r[8] = syscall(__NR_bpf, 0x0ul, 0x20ed1000ul, 0x1cul); break; case 2: *(uint32_t*)0x20bc1fd0 = (uint32_t)0x6; *(uint32_t*)0x20bc1fd4 = (uint32_t)0x3; *(uint64_t*)0x20bc1fd8 = (uint64_t)0x20fba000; *(uint64_t*)0x20bc1fe0 = (uint64_t)0x20fba000; *(uint32_t*)0x20bc1fe8 = (uint32_t)0x1; *(uint32_t*)0x20bc1fec = (uint32_t)0x0; *(uint64_t*)0x20bc1ff0 = (uint64_t)0x20fbafd6; *(uint32_t*)0x20bc1ff8 = (uint32_t)0x7; *(uint32_t*)0x20bc1ffc = (uint32_t)0x1; *(uint8_t*)0x20fba000 = (uint8_t)0x5; *(uint8_t*)0x20fba001 = (uint8_t)0xfffffffffffffffc; *(uint16_t*)0x20fba002 = (uint16_t)0x3; *(uint32_t*)0x20fba004 = (uint32_t)0xffffffffffffffff; *(uint8_t*)0x20fba008 = (uint8_t)0x5; *(uint8_t*)0x20fba009 = (uint8_t)0x0; *(uint16_t*)0x20fba00a = (uint16_t)0x1; *(uint32_t*)0x20fba00c = (uint32_t)0x3; *(uint8_t*)0x20fba010 = (uint8_t)0x1; *(uint8_t*)0x20fba011 = (uint8_t)0x3; *(uint16_t*)0x20fba012 = (uint16_t)0xffffffffffffff80; *(uint32_t*)0x20fba014 = (uint32_t)0xffffffffffffffff; memcpy((void*)0x20fba000, "\x2f\x65\x74\x68\x30\x2b\x63\x70\x75\x73\x65\x74\x00", 13); r[31] = syscall(__NR_bpf, 0x5ul, 0x20bc1fd0ul, 0x30ul); break; } return 0; } void test() { long i; pthread_t th[6]; memset(r, -1, sizeof(r)); srand(getpid()); for (i = 0; i < 3; i++) { pthread_create(&th[i], 0, thr, (void*)i); usleep(rand() % 10000); } for (i = 0; i < 3; i++) { pthread_create(&th[3 + 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; }