// https://syzkaller.appspot.com/bug?id=40235fa305e3c6e0654b197849cdabc21b3ad06c // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #ifndef __NR_mbind #define __NR_mbind 235 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_mremap #define __NR_mremap 216 #endif #ifndef __NR_socketpair #define __NR_socketpair 199 #endif int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000, /*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=*/0x1000, /*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)) { } // socketpair$unix arguments: [ // domain: const = 0x1 (8 bytes) // type: unix_socket_type = 0x2 (8 bytes) // proto: const = 0x0 (4 bytes) // fds: ptr[out, unix_pair] { // unix_pair { // fd0: sock_unix (resource) // fd1: sock_unix (resource) // } // } // ] syscall(__NR_socketpair, /*domain=*/1ul, /*type=SOCK_DGRAM*/ 2ul, /*proto=*/0, /*fds=*/0x20000080ul); // mremap arguments: [ // addr: VMA[0x1000] // len: len = 0x1000 (8 bytes) // newlen: len = 0x400000 (8 bytes) // flags: mremap_flags = 0x3 (8 bytes) // newaddr: VMA[0x400000] // ] syscall(__NR_mremap, /*addr=*/0x20a96000ul, /*len=*/0x1000ul, /*newlen=*/0x400000ul, /*flags=MREMAP_FIXED|MREMAP_MAYMOVE*/ 3ul, /*newaddr=*/0x20000000ul); // mremap arguments: [ // addr: VMA[0x9000] // len: len = 0x600002 (8 bytes) // newlen: len = 0x600002 (8 bytes) // flags: mremap_flags = 0x7 (8 bytes) // newaddr: VMA[0x600000] // ] syscall(__NR_mremap, /*addr=*/0x20000000ul, /*len=*/0x600002ul, /*newlen=*/0x600002ul, /*flags=MREMAP_FIXED|MREMAP_MAYMOVE|0x4*/ 7ul, /*newaddr=*/0x20a00000ul); // mbind arguments: [ // addr: VMA[0x800000] // len: len = 0x800000 (8 bytes) // mode: mbind_mode = 0x1 (8 bytes) // nodemask: nil // maxnode: intptr = 0x7 (8 bytes) // flags: mbind_flags = 0x2 (8 bytes) // ] syscall(__NR_mbind, /*addr=*/0x20001000ul, /*len=*/0x800000ul, /*mode=MPOL_PREFERRED*/ 1ul, /*nodemask=*/0ul, /*maxnode=*/7ul, /*flags=MPOL_MF_MOVE*/ 2ul); return 0; }