// https://syzkaller.appspot.com/bug?id=40abc1f181d9c0f680a6f31245098d4314e162e8 // 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, 0x0, 0xffffffffffffffff, 0xffffffffffffffff, 0x0}; int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); intptr_t res = 0; res = syscall(__NR_socket, 0x11ul, 2ul, 0x300); if (res != -1) r[0] = res; memcpy((void*)0x20000180, "bond0\000\000\000\000\000\000\000\000\000\000\000", 16); res = syscall(__NR_ioctl, r[0], 0x8933, 0x20000180ul); if (res != -1) r[1] = *(uint32_t*)0x20000190; *(uint16_t*)0x20000100 = 0x11; *(uint16_t*)0x20000102 = htobe16(0); *(uint32_t*)0x20000104 = r[1]; *(uint16_t*)0x20000108 = 1; *(uint8_t*)0x2000010a = 9; *(uint8_t*)0x2000010b = 6; memset((void*)0x2000010c, 170, 5); *(uint8_t*)0x20000111 = 0xaa; memset((void*)0x20000112, 0, 2); syscall(__NR_bind, -1, 0x20000100ul, 0x14ul); res = syscall(__NR_socket, 0x10ul, 3ul, 0); if (res != -1) r[2] = res; res = syscall(__NR_socket, 1ul, 0x803ul, 0); if (res != -1) r[3] = res; *(uint32_t*)0x200000c0 = 0x14; res = syscall(__NR_getsockname, r[3], 0x20000100ul, 0x200000c0ul); if (res != -1) r[4] = *(uint32_t*)0x20000104; *(uint64_t*)0x20000080 = 0; *(uint32_t*)0x20000088 = 0; *(uint64_t*)0x20000090 = 0x20000000; *(uint64_t*)0x20000000 = 0x200003c0; *(uint32_t*)0x200003c0 = 0xe4; *(uint16_t*)0x200003c4 = 0x10; *(uint16_t*)0x200003c6 = 0x401; *(uint32_t*)0x200003c8 = 0; *(uint32_t*)0x200003cc = 0; *(uint8_t*)0x200003d0 = 0; *(uint8_t*)0x200003d1 = 0; *(uint16_t*)0x200003d2 = 0; *(uint32_t*)0x200003d4 = 0; *(uint32_t*)0x200003d8 = 0; *(uint32_t*)0x200003dc = 0x22822; *(uint16_t*)0x200003e0 = 0x1c; STORE_BY_BITMASK(uint16_t, , 0x200003e2, 0x12, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003e3, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003e3, 1, 7, 1); *(uint16_t*)0x200003e4 = 0xc; *(uint16_t*)0x200003e6 = 1; memcpy((void*)0x200003e8, "macvlan\000", 8); *(uint16_t*)0x200003f0 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200003f2, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003f3, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003f3, 1, 7, 1); *(uint16_t*)0x200003f4 = 8; *(uint16_t*)0x200003f6 = 1; *(uint32_t*)0x200003f8 = 8; *(uint16_t*)0x200003fc = 8; *(uint16_t*)0x200003fe = 5; *(uint32_t*)0x20000400 = r[1]; *(uint16_t*)0x20000404 = 8; *(uint16_t*)0x20000406 = 0xa; *(uint32_t*)0x20000408 = r[4]; *(uint16_t*)0x2000040c = 8; *(uint16_t*)0x2000040e = 0xf; *(uint32_t*)0x20000410 = 0xfdfffffc; *(uint16_t*)0x20000414 = 8; *(uint16_t*)0x20000416 = 0x29; *(uint32_t*)0x20000418 = 0x7994; *(uint16_t*)0x2000041c = 0x14; *(uint16_t*)0x2000041e = 0x14; memcpy((void*)0x20000420, "veth1\000\000\000\000\000\000\000\000\000\000\000", 16); *(uint16_t*)0x20000430 = 0xa; *(uint16_t*)0x20000432 = 1; memset((void*)0x20000434, 170, 5); *(uint8_t*)0x20000439 = 0xbb; *(uint16_t*)0x2000043c = 0x68; STORE_BY_BITMASK(uint16_t, , 0x2000043e, 0x34, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000043f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000043f, 1, 7, 1); *(uint16_t*)0x20000440 = 0x14; *(uint16_t*)0x20000442 = 0x35; memcpy((void*)0x20000444, "vlan0\000\000\000\000\000\000\000\000\000\000\000", 16); *(uint16_t*)0x20000454 = 0x14; *(uint16_t*)0x20000456 = 0x35; memcpy((void*)0x20000458, "vxcan1\000\000\000\000\000\000\000\000\000\000", 16); *(uint16_t*)0x20000468 = 0x14; *(uint16_t*)0x2000046a = 0x35; memcpy((void*)0x2000046c, "bond_slave_1\000\000\000\000", 16); *(uint16_t*)0x2000047c = 0x14; *(uint16_t*)0x2000047e = 0x35; memcpy((void*)0x20000480, "veth0_to_bridge\000", 16); *(uint16_t*)0x20000490 = 0x14; *(uint16_t*)0x20000492 = 0x35; memcpy((void*)0x20000494, "veth0_vlan\000\000\000\000\000\000", 16); *(uint64_t*)0x20000008 = 0xe4; *(uint64_t*)0x20000098 = 1; *(uint64_t*)0x200000a0 = 0; *(uint64_t*)0x200000a8 = 0; *(uint32_t*)0x200000b0 = 0; syscall(__NR_sendmsg, r[2], 0x20000080ul, 0ul); return 0; }