// https://syzkaller.appspot.com/bug?id=a1124c09589cb5202e78d5f002a13ed018a3a355 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include uint64_t r[2] = {0xffffffffffffffff, 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*)0x200000000000, "/dev/netmap\000", 12); res = syscall(SYS_openat, /*fd=*/0xffffff9cul, /*file=*/0x200000000000ul, /*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: {20 b5 40 c6 06 00 00 00 f9 ff ff ff db b9 1f 24} // (length 0x10) nr_version: int32 = 0x80001002 (4 bytes) nr_offset: // int32 = 0x5 (4 bytes) nr_memsize: int32 = 0xfffffffe (4 bytes) // nr_tx_slots: int32 = 0x4 (4 bytes) // nr_rx_slots: int32 = 0xb7 (4 bytes) // nr_tx_rings: int16 = 0x7 (2 bytes) // nr_rx_rings: int16 = 0x1 (2 bytes) // nr_ringid: nmreq_register_ringid = 0xefff (2 bytes) // nr_cmd: nmreq_nr_cmds = 0x0 (2 bytes) // nr_arg1: int16 = 0x0 (2 bytes) // nr_arg2: int16 = 0x1 (2 bytes) // nr_arg3: int32 = 0xfc54 (4 bytes) // nr_flags: nmreq_register_modes = 0x6 (4 bytes) // spare2: array[int32] { // int32 = 0x8003fffd (4 bytes) // } // } // } // ] memcpy((void*)0x200000000040, "\x20\xb5\x40\xc6\x06\x00\x00\x00\xf9\xff\xff\xff\xdb\xb9\x1f\x24", 16); *(uint32_t*)0x200000000050 = 0x80001002; *(uint32_t*)0x200000000054 = 5; *(uint32_t*)0x200000000058 = 0xfffffffe; *(uint32_t*)0x20000000005c = 4; *(uint32_t*)0x200000000060 = 0xb7; *(uint16_t*)0x200000000064 = 7; *(uint16_t*)0x200000000066 = 1; *(uint16_t*)0x200000000068 = 0xefff; *(uint16_t*)0x20000000006a = 0; *(uint16_t*)0x20000000006c = 0; *(uint16_t*)0x20000000006e = 1; *(uint32_t*)0x200000000070 = 0xfc54; *(uint32_t*)0x200000000074 = 6; *(uint32_t*)0x200000000078 = 0x8003fffd; syscall(SYS_ioctl, /*fd=*/r[0], /*cmd=*/0xc03c6992ul, /*arg=*/0x200000000040ul); // 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 = 0x40 (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=FASYNC*/ 0x40ul, /*mode=*/0ul); if (res != -1) r[1] = res; // socket$inet6_udplite arguments: [ // domain: const = 0x1c (8 bytes) // type: const = 0x2 (8 bytes) // proto: const = 0x88 (1 bytes) // ] // returns sock_udplite6 syscall(SYS_socket, /*domain=*/0x1cul, /*type=*/2ul, /*proto=*/0x88); // ioctl$NIOCREGIF arguments: [ // fd: fd_netmap (resource) // cmd: const = 0xc03c6992 (8 bytes) // arg: ptr[inout, nmreq] { // nmreq { // nr_name: buffer: {20 b5 40 c6 06 00 00 00 f9 ff ff ff db b9 1f 24} // (length 0x10) nr_version: int32 = 0x80000002 (4 bytes) nr_offset: // int32 = 0x5 (4 bytes) nr_memsize: int32 = 0xc (4 bytes) nr_tx_slots: // int32 = 0x4 (4 bytes) nr_rx_slots: int32 = 0x100 (4 bytes) // nr_tx_rings: int16 = 0x7 (2 bytes) // nr_rx_rings: int16 = 0x2 (2 bytes) // nr_ringid: nmreq_register_ringid = 0xb000 (2 bytes) // nr_cmd: nmreq_nr_cmds = 0x0 (2 bytes) // nr_arg1: int16 = 0x8001 (2 bytes) // nr_arg2: int16 = 0x1 (2 bytes) // nr_arg3: int32 = 0x9 (4 bytes) // nr_flags: nmreq_register_modes = 0x4 (4 bytes) // spare2: array[int32] { // int32 = 0x1000 (4 bytes) // } // } // } // ] memcpy((void*)0x200000000180, "\x20\xb5\x40\xc6\x06\x00\x00\x00\xf9\xff\xff\xff\xdb\xb9\x1f\x24", 16); *(uint32_t*)0x200000000190 = 0x80000002; *(uint32_t*)0x200000000194 = 5; *(uint32_t*)0x200000000198 = 0xc; *(uint32_t*)0x20000000019c = 4; *(uint32_t*)0x2000000001a0 = 0x100; *(uint16_t*)0x2000000001a4 = 7; *(uint16_t*)0x2000000001a6 = 2; *(uint16_t*)0x2000000001a8 = 0xb000; *(uint16_t*)0x2000000001aa = 0; *(uint16_t*)0x2000000001ac = 0x8001; *(uint16_t*)0x2000000001ae = 1; *(uint32_t*)0x2000000001b0 = 9; *(uint32_t*)0x2000000001b4 = 4; *(uint32_t*)0x2000000001b8 = 0x1000; syscall(SYS_ioctl, /*fd=*/r[1], /*cmd=*/0xc03c6992ul, /*arg=*/0x200000000180ul); return 0; }