// https://syzkaller.appspot.com/bug?id=1ab62601ed8e2b3db0de34985bff9933341f57fa // 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 = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 6e 65 74 6d 61 70 00} (length 0xc) // } // flags: open_flags = 0x246 (8 bytes) // mode: const = 0x0 (8 bytes) // ] // returns fd_netmap memcpy((void*)0x200000000100, "/dev/netmap\000", 12); res = syscall( SYS_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000100ul, /*flags=O_NONBLOCK|O_CREAT|FASYNC|O_RDWR*/ 0x246ul, /*mode=*/0ul); if (res != -1) r[0] = res; // ioctl$NIOCCTRL arguments: [ // fd: fd_netmap (resource) // cmd: const = 0xc0586997 (8 bytes) // arg: ptr[inout, nmreq_header] { // nmreq_header { // nr_version: const = 0xe (2 bytes) // nr_reqtype: netmap_req_types = 0x5 (2 bytes) // nr_reserved: const = 0x0 (4 bytes) // nr_name: buffer: {00 00 00 00 2b 73 02 5a 03 b4 64 df 9d 78 f4 9e 00 // ea 71 d0 12 f3 e6 b4 66 9a b0 76 3d 5a cb 05 00 f1 ff 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00} (length 0x40) nr_options: nil nr_body: ptr[inout, nmreq_body] { // union nmreq_body { // vale_list: nmreq_vale_list { // nr_bridge_idx: int16 = 0x4 (2 bytes) // pad1: const = 0x0 (2 bytes) // nr_port_idx: int32 = 0xffff3518 (4 bytes) // } // } // } // } // } // ] *(uint16_t*)0x200000000280 = 0xe; *(uint16_t*)0x200000000282 = 5; *(uint32_t*)0x200000000284 = 0; memcpy((void*)0x200000000288, "\x00\x00\x00\x00\x2b\x73\x02\x5a\x03\xb4\x64\xdf\x9d\x78\xf4\x9e\x00" "\xea\x71\xd0\x12\xf3\xe6\xb4\x66\x9a\xb0\x76\x3d\x5a\xcb\x05\x00\xf1" "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 64); *(uint64_t*)0x2000000002c8 = 0; *(uint64_t*)0x2000000002d0 = 0x200000000040; *(uint16_t*)0x200000000040 = 4; *(uint16_t*)0x200000000042 = 0; *(uint32_t*)0x200000000044 = 0xffff3518; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0xc0586997ul, /*arg=*/0x200000000280ul); return 0; }