// https://syzkaller.appspot.com/bug?id=ad955c52e560cf915fe080727cbfce3760e1ffea // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off)) #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \ *(type*)(addr) = \ htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \ (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len)))) uint64_t r[5] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0x0}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-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=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } res = syscall(__NR_socket, /*domain=AF_NETLINK*/ 0x10ul, /*type=SOCK_NONBLOCK|SOCK_RAW*/ 0x803ul, /*proto=*/0); if (res != -1) r[0] = res; memcpy((void*)0x20000240, "/dev/net/tun\000", 13); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x20000240ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[1] = res; memcpy((void*)0x20000040, "syzkaller0\000\000\000\000\000\000", 16); *(uint16_t*)0x20000050 = 0x7101; syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x400454ca, /*arg=*/0x20000040ul); res = syscall(__NR_socket, /*domain=AF_NETLINK|0x400000000000*/ 0x400000000010ul, /*type=SOCK_RAW*/ 3ul, /*proto=*/0); if (res != -1) r[2] = res; res = syscall(__NR_socket, /*domain=*/1ul, /*type=SOCK_STREAM*/ 1ul, /*proto=*/0); if (res != -1) r[3] = res; memcpy((void*)0x20000100, "syzkaller0\000\000\000\000\000\000", 16); res = syscall(__NR_ioctl, /*fd=*/r[3], /*cmd=*/0x8933, /*arg=*/0x20000100ul); if (res != -1) r[4] = *(uint32_t*)0x20000110; *(uint64_t*)0x200012c0 = 0; *(uint32_t*)0x200012c8 = 0; *(uint64_t*)0x200012d0 = 0x20000080; *(uint64_t*)0x20000080 = 0x200005c0; *(uint32_t*)0x200005c0 = 0x38; *(uint16_t*)0x200005c4 = 0x24; *(uint16_t*)0x200005c6 = 0x6541; *(uint32_t*)0x200005c8 = 0x70bd2a; *(uint32_t*)0x200005cc = -1; *(uint8_t*)0x200005d0 = 0; *(uint8_t*)0x200005d1 = 0; *(uint16_t*)0x200005d2 = 0; *(uint32_t*)0x200005d4 = r[4]; *(uint16_t*)0x200005d8 = 0; *(uint16_t*)0x200005da = 0xfff1; *(uint16_t*)0x200005dc = -1; *(uint16_t*)0x200005de = -1; *(uint16_t*)0x200005e0 = 0; *(uint16_t*)0x200005e2 = 0; *(uint16_t*)0x200005e4 = 0xb; *(uint16_t*)0x200005e6 = 1; memcpy((void*)0x200005e8, "multiq\000", 7); *(uint16_t*)0x200005f0 = 8; *(uint16_t*)0x200005f2 = 2; *(uint16_t*)0x200005f4 = 0; *(uint16_t*)0x200005f6 = 0; *(uint64_t*)0x20000088 = 0x38; *(uint64_t*)0x200012d8 = 1; *(uint64_t*)0x200012e0 = 0; *(uint64_t*)0x200012e8 = 0; *(uint32_t*)0x200012f0 = 0; syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0x200012c0ul, /*f=*/0ul); *(uint64_t*)0x20000580 = 0; *(uint32_t*)0x20000588 = 0; *(uint64_t*)0x20000590 = 0x20000300; *(uint64_t*)0x20000300 = 0x20001300; *(uint32_t*)0x20001300 = 0x84; *(uint16_t*)0x20001304 = 0x2c; *(uint16_t*)0x20001306 = 0xd27; *(uint32_t*)0x20001308 = 0x30bd29; *(uint32_t*)0x2000130c = 2; *(uint8_t*)0x20001310 = 0; *(uint8_t*)0x20001311 = 0; *(uint16_t*)0x20001312 = 0; *(uint32_t*)0x20001314 = r[4]; *(uint16_t*)0x20001318 = 0; *(uint16_t*)0x2000131a = 0xf; *(uint16_t*)0x2000131c = 0; *(uint16_t*)0x2000131e = 0; *(uint16_t*)0x20001320 = 7; *(uint16_t*)0x20001322 = 0; *(uint16_t*)0x20001324 = 0xd; *(uint16_t*)0x20001326 = 1; memcpy((void*)0x20001328, "matchall\000", 9); *(uint16_t*)0x20001334 = 0x50; *(uint16_t*)0x20001336 = 2; *(uint16_t*)0x20001338 = 0x4c; *(uint16_t*)0x2000133a = 2; *(uint16_t*)0x2000133c = 0x48; STORE_BY_BITMASK(uint16_t, , 0x2000133e, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000133f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000133f, 0, 7, 1); *(uint16_t*)0x20001340 = 9; *(uint16_t*)0x20001342 = 1; memcpy((void*)0x20001344, "gact\000", 5); *(uint16_t*)0x2000134c = 0x1c; STORE_BY_BITMASK(uint16_t, , 0x2000134e, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000134f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000134f, 1, 7, 1); *(uint16_t*)0x20001350 = 0x18; *(uint16_t*)0x20001352 = 2; *(uint32_t*)0x20001354 = 0x40; *(uint32_t*)0x20001358 = 0x400; *(uint32_t*)0x2000135c = 5; *(uint32_t*)0x20001360 = 0x80; *(uint32_t*)0x20001364 = 7; *(uint16_t*)0x20001368 = 4; *(uint16_t*)0x2000136a = 6; *(uint16_t*)0x2000136c = 0xc; *(uint16_t*)0x2000136e = 7; *(uint32_t*)0x20001370 = 0; *(uint32_t*)0x20001374 = 0; *(uint16_t*)0x20001378 = 0xc; *(uint16_t*)0x2000137a = 8; *(uint32_t*)0x2000137c = 2; *(uint32_t*)0x20001380 = 2; *(uint64_t*)0x20000308 = 0x84; *(uint64_t*)0x20000598 = 1; *(uint64_t*)0x200005a0 = 0; *(uint64_t*)0x200005a8 = 0; *(uint32_t*)0x200005b0 = 0x10; syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0x20000580ul, /*f=*/0ul); return 0; }