// https://syzkaller.appspot.com/bug?id=58583553e35db710e1de660064edf1add53e16cb // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_futex #define __NR_futex 98 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_mprotect #define __NR_mprotect 226 #endif int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // mprotect arguments: [ // addr: VMA[0x4000] // len: len = 0x4000 (8 bytes) // prot: mmap_prot = 0x1 (8 bytes) // ] syscall(__NR_mprotect, /*addr=*/0x20000000ul, /*len=*/0x4000ul, /*prot=PROT_READ*/ 1ul); // futex arguments: [ // addr: nil // op: futex_op = 0x88 (8 bytes) // val: int32 = 0x0 (4 bytes) // timeout: nil // addr2: nil // val3: int32 = 0x0 (4 bytes) // ] syscall(__NR_futex, /*addr=*/0ul, /*op=FUTEX_PRIVATE_FLAG|FUTEX_TRYLOCK_PI*/ 0x88ul, /*val=*/0, /*timeout=*/0ul, /*addr2=*/0ul, /*val3=*/0); return 0; }