// https://syzkaller.appspot.com/bug?id=79c7cd17a7d2b58c5973606a4fa7e63d56974443 // 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)))) #ifndef __NR_mmap #define __NR_mmap 192 #endif #ifndef __NR_sendmsg #define __NR_sendmsg 370 #endif #ifndef __NR_socket #define __NR_socket 359 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); intptr_t res = 0; res = syscall(__NR_socket, 0x10, 3, 0xc); if (res != -1) r[0] = res; *(uint32_t*)0x20000300 = 0; *(uint32_t*)0x20000304 = 0; *(uint32_t*)0x20000308 = 0x200002c0; *(uint32_t*)0x200002c0 = 0x20000440; *(uint32_t*)0x20000440 = 0x50; *(uint8_t*)0x20000444 = 2; *(uint8_t*)0x20000445 = 6; *(uint16_t*)0x20000446 = 1; *(uint32_t*)0x20000448 = 0; *(uint32_t*)0x2000044c = 0; *(uint8_t*)0x20000450 = 0; *(uint8_t*)0x20000451 = 0; *(uint16_t*)0x20000452 = htobe16(0); *(uint16_t*)0x20000454 = 9; *(uint16_t*)0x20000456 = 2; memcpy((void*)0x20000458, "syz2\000", 5); *(uint16_t*)0x20000460 = 0xc; *(uint16_t*)0x20000462 = 3; memcpy((void*)0x20000464, "hash:ip\000", 8); *(uint16_t*)0x2000046c = 0xc; STORE_BY_BITMASK(uint16_t, , 0x2000046e, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000046f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000046f, 1, 7, 1); *(uint16_t*)0x20000470 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000472, 6, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000473, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000473, 0, 7, 1); *(uint32_t*)0x20000474 = htobe32(3); *(uint16_t*)0x20000478 = 5; *(uint16_t*)0x2000047a = 1; *(uint8_t*)0x2000047c = 7; *(uint16_t*)0x20000480 = 5; *(uint16_t*)0x20000482 = 4; *(uint8_t*)0x20000484 = 0; *(uint16_t*)0x20000488 = 5; *(uint16_t*)0x2000048a = 5; *(uint8_t*)0x2000048c = 2; *(uint32_t*)0x200002c4 = 0x50; *(uint32_t*)0x2000030c = 1; *(uint32_t*)0x20000310 = 0; *(uint32_t*)0x20000314 = 0; *(uint32_t*)0x20000318 = 0; syscall(__NR_sendmsg, (intptr_t)r[0], 0x20000300, 0); res = syscall(__NR_socket, 0x10, 3, 0xc); if (res != -1) r[1] = res; *(uint32_t*)0x20000500 = 0; *(uint32_t*)0x20000504 = 0; *(uint32_t*)0x20000508 = 0x200004c0; *(uint32_t*)0x200004c0 = 0x200003c0; *(uint32_t*)0x200003c0 = 0x100; *(uint8_t*)0x200003c4 = 0xb; *(uint8_t*)0x200003c5 = 6; *(uint16_t*)0x200003c6 = 1; *(uint32_t*)0x200003c8 = 0x70bd2d; *(uint32_t*)0x200003cc = 0x25dfdbfb; *(uint8_t*)0x200003d0 = 0x9a; *(uint8_t*)0x200003d1 = 0; *(uint16_t*)0x200003d2 = htobe16(5); *(uint16_t*)0x200003d4 = 8; STORE_BY_BITMASK(uint16_t, , 0x200003d6, 9, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003d7, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003d7, 0, 7, 1); *(uint32_t*)0x200003d8 = htobe32(0x40); *(uint16_t*)0x200003dc = 0x44; STORE_BY_BITMASK(uint16_t, , 0x200003de, 8, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003df, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003df, 1, 7, 1); *(uint16_t*)0x200003e0 = 0x10; STORE_BY_BITMASK(uint16_t, , 0x200003e2, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003e3, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003e3, 1, 7, 1); *(uint16_t*)0x200003e4 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200003e6, 0x18, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003e7, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003e7, 0, 7, 1); *(uint64_t*)0x200003e8 = htobe64(3); *(uint16_t*)0x200003f0 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200003f2, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003f3, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003f3, 1, 7, 1); *(uint16_t*)0x200003f4 = 8; STORE_BY_BITMASK(uint16_t, , 0x200003f6, 0xb, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003f7, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003f7, 0, 7, 1); *(uint32_t*)0x200003f8 = htobe32(0x81); *(uint16_t*)0x200003fc = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200003fe, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200003ff, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200003ff, 1, 7, 1); *(uint16_t*)0x20000400 = 5; *(uint16_t*)0x20000402 = 0x1a; memcpy((void*)0x20000404, "\000", 1); *(uint16_t*)0x20000408 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x2000040a, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000040b, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000040b, 1, 7, 1); *(uint16_t*)0x2000040c = 8; STORE_BY_BITMASK(uint16_t, , 0x2000040e, 0xa, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000040f, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000040f, 0, 7, 1); *(uint32_t*)0x20000410 = htobe32(8); *(uint16_t*)0x20000414 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000416, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000417, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000417, 1, 7, 1); *(uint16_t*)0x20000418 = 6; STORE_BY_BITMASK(uint16_t, , 0x2000041a, 0x1d, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000041b, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000041b, 0, 7, 1); *(uint16_t*)0x2000041c = htobe16(0x3f); *(uint16_t*)0x20000420 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000422, 9, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000423, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000423, 0, 7, 1); *(uint32_t*)0x20000424 = htobe32(9); *(uint16_t*)0x20000428 = 5; *(uint16_t*)0x2000042a = 1; *(uint8_t*)0x2000042c = 7; *(uint16_t*)0x20000430 = 5; *(uint16_t*)0x20000432 = 1; *(uint8_t*)0x20000434 = 7; *(uint16_t*)0x20000438 = 5; *(uint16_t*)0x2000043a = 1; *(uint8_t*)0x2000043c = 7; *(uint16_t*)0x20000440 = 9; *(uint16_t*)0x20000442 = 2; memcpy((void*)0x20000444, "syz2\000", 5); *(uint16_t*)0x2000044c = 0x30; STORE_BY_BITMASK(uint16_t, , 0x2000044e, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000044f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000044f, 1, 7, 1); *(uint16_t*)0x20000450 = 0x14; *(uint16_t*)0x20000452 = 0x17; memcpy((void*)0x20000454, "veth0_to_bridge\000", 16); *(uint16_t*)0x20000464 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000466, 0xa, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000467, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000467, 0, 7, 1); *(uint32_t*)0x20000468 = htobe32(0x2b); *(uint16_t*)0x2000046c = 6; STORE_BY_BITMASK(uint16_t, , 0x2000046e, 5, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000046f, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000046f, 0, 7, 1); *(uint16_t*)0x20000470 = htobe16(0x4e24); *(uint16_t*)0x20000474 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000476, 0xb, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000477, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000477, 0, 7, 1); *(uint32_t*)0x20000478 = htobe32(0x1f); *(uint16_t*)0x2000047c = 0x44; STORE_BY_BITMASK(uint16_t, , 0x2000047e, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000047f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000047f, 1, 7, 1); *(uint16_t*)0x20000480 = 0x18; STORE_BY_BITMASK(uint16_t, , 0x20000482, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000483, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000483, 1, 7, 1); *(uint16_t*)0x20000484 = 0x14; STORE_BY_BITMASK(uint16_t, , 0x20000486, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000487, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000487, 0, 7, 1); *(uint8_t*)0x20000488 = -1; *(uint8_t*)0x20000489 = 2; *(uint8_t*)0x2000048a = 0; *(uint8_t*)0x2000048b = 0; *(uint8_t*)0x2000048c = 0; *(uint8_t*)0x2000048d = 0; *(uint8_t*)0x2000048e = 0; *(uint8_t*)0x2000048f = 0; *(uint8_t*)0x20000490 = 0; *(uint8_t*)0x20000491 = 0; *(uint8_t*)0x20000492 = 0; *(uint8_t*)0x20000493 = 0; *(uint8_t*)0x20000494 = 0; *(uint8_t*)0x20000495 = 0; *(uint8_t*)0x20000496 = 0; *(uint8_t*)0x20000497 = 1; *(uint16_t*)0x20000498 = 0x18; STORE_BY_BITMASK(uint16_t, , 0x2000049a, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000049b, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000049b, 1, 7, 1); *(uint16_t*)0x2000049c = 0x14; STORE_BY_BITMASK(uint16_t, , 0x2000049e, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000049f, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000049f, 0, 7, 1); *(uint8_t*)0x200004a0 = 0xfe; *(uint8_t*)0x200004a1 = 0x80; *(uint8_t*)0x200004a2 = 0; *(uint8_t*)0x200004a3 = 0; *(uint8_t*)0x200004a4 = 0; *(uint8_t*)0x200004a5 = 0; *(uint8_t*)0x200004a6 = 0; *(uint8_t*)0x200004a7 = 0; *(uint8_t*)0x200004a8 = 0; *(uint8_t*)0x200004a9 = 0; *(uint8_t*)0x200004aa = 0; *(uint8_t*)0x200004ab = 0; *(uint8_t*)0x200004ac = 0; *(uint8_t*)0x200004ad = 0; *(uint8_t*)0x200004ae = 0; *(uint8_t*)0x200004af = 0xa; *(uint16_t*)0x200004b0 = 8; STORE_BY_BITMASK(uint16_t, , 0x200004b2, 9, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004b3, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004b3, 0, 7, 1); *(uint32_t*)0x200004b4 = htobe32(0x9b); *(uint16_t*)0x200004b8 = 8; STORE_BY_BITMASK(uint16_t, , 0x200004ba, 6, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200004bb, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200004bb, 0, 7, 1); *(uint32_t*)0x200004bc = htobe32(0x80); *(uint32_t*)0x200004c4 = 0x100; *(uint32_t*)0x2000050c = 1; *(uint32_t*)0x20000510 = 0; *(uint32_t*)0x20000514 = 0; *(uint32_t*)0x20000518 = 0x40000; syscall(__NR_sendmsg, (intptr_t)r[1], 0x20000500, 0); return 0; }