// https://syzkaller.appspot.com/bug?id=f98813c9a92c13238b7b643b31b9c7125c2f6b45 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(SYS_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x1012ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // openat$netmap arguments: [ // fd: const = 0xffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 6e 65 74 6d 61 70 00} (length 0xc) // } // flags: open_flags = 0x80000 (8 bytes) // mode: const = 0x0 (8 bytes) // ] // returns fd_netmap memcpy((void*)0x200000000080, "/dev/netmap\000", 12); res = syscall(SYS_openat, /*fd=*/0xffffff9cul, /*file=*/0x200000000080ul, /*flags=O_TTY_INIT*/ 0x80000ul, /*mode=*/0ul); if (res != -1) r[0] = res; // ioctl$NIOCREGIF arguments: [ // fd: fd_netmap (resource) // cmd: const = 0xc03c6992 (8 bytes) // arg: ptr[inout, nmreq] { // nmreq { // nr_name: buffer: {1e 5e bf 9f 1e 72 25 62 12 e8 99 6f bd 6f c4 73} // (length 0x10) nr_version: int32 = 0x426d (4 bytes) nr_offset: int32 // = 0x8001 (4 bytes) nr_memsize: int32 = 0x8 (4 bytes) nr_tx_slots: // int32 = 0xfcb (4 bytes) nr_rx_slots: int32 = 0x1000 (4 bytes) // nr_tx_rings: int16 = 0x7 (2 bytes) // nr_rx_rings: int16 = 0x4 (2 bytes) // nr_ringid: nmreq_register_ringid = 0x1ffe (2 bytes) // nr_cmd: nmreq_nr_cmds = 0x6 (2 bytes) // nr_arg1: int16 = 0x6 (2 bytes) // nr_arg2: int16 = 0x8 (2 bytes) // nr_arg3: int32 = 0x7ff (4 bytes) // nr_flags: nmreq_register_modes = 0x3 (4 bytes) // spare2: array[int32] { // int32 = 0x6 (4 bytes) // } // } // } // ] memcpy((void*)0x200000000000, "\x1e\x5e\xbf\x9f\x1e\x72\x25\x62\x12\xe8\x99\x6f\xbd\x6f\xc4\x73", 16); *(uint32_t*)0x200000000010 = 0x426d; *(uint32_t*)0x200000000014 = 0x8001; *(uint32_t*)0x200000000018 = 8; *(uint32_t*)0x20000000001c = 0xfcb; *(uint32_t*)0x200000000020 = 0x1000; *(uint16_t*)0x200000000024 = 7; *(uint16_t*)0x200000000026 = 4; *(uint16_t*)0x200000000028 = 0x1ffe; *(uint16_t*)0x20000000002a = 6; *(uint16_t*)0x20000000002c = 6; *(uint16_t*)0x20000000002e = 8; *(uint32_t*)0x200000000030 = 0x7ff; *(uint32_t*)0x200000000034 = 3; *(uint32_t*)0x200000000038 = 6; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0xc03c6992ul, /*arg=*/0x200000000000ul); return 0; }