// https://syzkaller.appspot.com/bug?id=acbdbce572deeb65f3e0e5b7705bdb8d16b1210f // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_ioctl #define __NR_ioctl 29 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_sendmsg #define __NR_sendmsg 211 #endif #ifndef __NR_socket #define __NR_socket 198 #endif #ifndef __NR_socketpair #define __NR_socketpair 199 #endif #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[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0x0}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); intptr_t res = 0; res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0); if (res != -1) r[0] = res; res = syscall(__NR_socketpair, /*domain=*/1ul, /*type=*/1ul, /*proto=*/0, /*fds=*/0x20000080ul); if (res != -1) r[1] = *(uint32_t*)0x20000084; memcpy((void*)0x20000000, "lo\000\000\000\000\000\000\000\000\000\000\000\000\000\000", 16); res = syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x8933, /*arg=*/0x20000000ul); if (res != -1) r[2] = *(uint32_t*)0x20000010; *(uint64_t*)0x20000040 = 0; *(uint32_t*)0x20000048 = 0; *(uint64_t*)0x20000050 = 0x20000780; *(uint64_t*)0x20000780 = 0x20000240; *(uint32_t*)0x20000240 = 0x148; *(uint16_t*)0x20000244 = 0x24; *(uint16_t*)0x20000246 = 0xf0b; *(uint32_t*)0x20000248 = 0; *(uint32_t*)0x2000024c = 0; *(uint8_t*)0x20000250 = 0x60; *(uint8_t*)0x20000251 = 0; *(uint16_t*)0x20000252 = 0; *(uint32_t*)0x20000254 = r[2]; *(uint16_t*)0x20000258 = 0; *(uint16_t*)0x2000025a = 0; *(uint16_t*)0x2000025c = -1; *(uint16_t*)0x2000025e = -1; *(uint16_t*)0x20000260 = 0; *(uint16_t*)0x20000262 = 0; *(uint16_t*)0x20000264 = 0xa; *(uint16_t*)0x20000266 = 1; memcpy((void*)0x20000268, "netem\000", 6); *(uint16_t*)0x20000270 = 0x118; *(uint16_t*)0x20000272 = 2; *(uint32_t*)0x20000274 = 0; *(uint32_t*)0x20000278 = 0; *(uint32_t*)0x2000027c = 0; *(uint32_t*)0x20000280 = 0; *(uint32_t*)0x20000284 = 0; *(uint32_t*)0x20000288 = 0; *(uint16_t*)0x2000028c = 0xc0; STORE_BY_BITMASK(uint16_t, , 0x2000028e, 0xd, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000028f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000028f, 1, 7, 1); *(uint16_t*)0x20000290 = 0x14; *(uint16_t*)0x20000292 = 2; *(uint32_t*)0x20000294 = 0; *(uint32_t*)0x20000298 = 0; *(uint32_t*)0x2000029c = 0; *(uint32_t*)0x200002a0 = 0; *(uint16_t*)0x200002a4 = 0; *(uint16_t*)0x200002a6 = 1; *(uint32_t*)0x200002a8 = 0; *(uint32_t*)0x200002ac = 0; *(uint32_t*)0x200002b0 = 0; *(uint32_t*)0x200002b4 = 0; *(uint32_t*)0x200002b8 = 0; *(uint16_t*)0x200002bc = 0x14; *(uint16_t*)0x200002be = 2; *(uint32_t*)0x200002c0 = 0; *(uint32_t*)0x200002c4 = 0; *(uint32_t*)0x200002c8 = 0; *(uint32_t*)0x200002cc = 0; *(uint16_t*)0x200002d0 = 0x14; *(uint16_t*)0x200002d2 = 2; *(uint32_t*)0x200002d4 = 0; *(uint32_t*)0x200002d8 = 0; *(uint32_t*)0x200002dc = 0; *(uint32_t*)0x200002e0 = 0; *(uint16_t*)0x200002e4 = 0x25; *(uint16_t*)0x200002e6 = 1; *(uint32_t*)0x200002e8 = 0; *(uint32_t*)0x200002ec = 0; *(uint32_t*)0x200002f0 = 0; *(uint32_t*)0x200002f4 = 0; *(uint32_t*)0x200002f8 = 0; *(uint16_t*)0x200002fc = 0x14; *(uint16_t*)0x200002fe = 2; *(uint32_t*)0x20000300 = 0; *(uint32_t*)0x20000304 = 0; *(uint32_t*)0x20000308 = 0; *(uint32_t*)0x2000030c = 0; *(uint16_t*)0x20000310 = 0x14; *(uint16_t*)0x20000312 = 2; *(uint32_t*)0x20000314 = 0; *(uint32_t*)0x20000318 = 0; *(uint32_t*)0x2000031c = 0; *(uint32_t*)0x20000320 = 0; *(uint16_t*)0x20000324 = 0x18; *(uint16_t*)0x20000326 = 1; *(uint32_t*)0x20000328 = 0; *(uint32_t*)0x2000032c = 0; *(uint32_t*)0x20000330 = 0; *(uint32_t*)0x20000334 = 0; *(uint32_t*)0x20000338 = 0; *(uint16_t*)0x2000033c = 0x14; *(uint16_t*)0x2000033e = 2; *(uint32_t*)0x20000340 = 0; *(uint32_t*)0x20000344 = 0; *(uint32_t*)0x20000348 = 0; *(uint32_t*)0x2000034c = 0; *(uint16_t*)0x20000350 = 0x10; *(uint16_t*)0x20000352 = 1; *(uint32_t*)0x20000354 = 0; *(uint32_t*)0x20000358 = 0; *(uint32_t*)0x2000035c = 0; *(uint16_t*)0x20000360 = 0xc; *(uint16_t*)0x20000362 = 0xb; *(uint64_t*)0x20000364 = 0; *(uint16_t*)0x2000036c = 8; *(uint16_t*)0x2000036e = 7; *(uint32_t*)0x20000370 = 0; *(uint16_t*)0x20000374 = 0xc; *(uint16_t*)0x20000376 = 4; *(uint32_t*)0x20000378 = 0; *(uint32_t*)0x2000037c = 0; *(uint16_t*)0x20000380 = 0xc; *(uint16_t*)0x20000382 = 0xa; *(uint64_t*)0x20000384 = 0; *(uint64_t*)0x20000788 = 0x148; *(uint64_t*)0x20000058 = 1; *(uint64_t*)0x20000060 = 0; *(uint64_t*)0x20000068 = 0; *(uint32_t*)0x20000070 = 0; syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0x20000040ul, /*f=*/0ul); return 0; }