// https://syzkaller.appspot.com/bug?id=115c7dc1e6c389810b4a0befae8da0a5042629e5 // 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 = 0x20000000; *(uint32_t*)0x20000000 = 0x64; *(uint8_t*)0x20000004 = 2; *(uint8_t*)0x20000005 = 6; *(uint16_t*)0x20000006 = 1; *(uint32_t*)0x20000008 = 0; *(uint32_t*)0x2000000c = 0; *(uint8_t*)0x20000010 = 0; *(uint8_t*)0x20000011 = 0; *(uint16_t*)0x20000012 = htobe16(0); *(uint16_t*)0x20000014 = 0xe; *(uint16_t*)0x20000016 = 3; memcpy((void*)0x20000018, "bitmap:ip\000", 10); *(uint16_t*)0x20000024 = 9; *(uint16_t*)0x20000026 = 2; memcpy((void*)0x20000028, "syz1\000", 5); *(uint16_t*)0x20000030 = 0x1c; STORE_BY_BITMASK(uint16_t, , 0x20000032, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000033, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000033, 1, 7, 1); *(uint16_t*)0x20000034 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000036, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000037, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000037, 1, 7, 1); *(uint16_t*)0x20000038 = 8; STORE_BY_BITMASK(uint16_t, , 0x2000003a, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000003b, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000003b, 0, 7, 1); *(uint32_t*)0x2000003c = htobe32(3); *(uint16_t*)0x20000040 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x20000042, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000043, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000043, 1, 7, 1); *(uint16_t*)0x20000044 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000046, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000047, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000047, 0, 7, 1); *(uint32_t*)0x20000048 = htobe32(0); *(uint16_t*)0x2000004c = 5; *(uint16_t*)0x2000004e = 1; *(uint8_t*)0x20000050 = 7; *(uint16_t*)0x20000054 = 5; *(uint16_t*)0x20000056 = 4; *(uint8_t*)0x20000058 = 0; *(uint16_t*)0x2000005c = 5; *(uint16_t*)0x2000005e = 5; *(uint8_t*)0x20000060 = 2; *(uint32_t*)0x200002c4 = 0x64; *(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*)0x20000080 = 0; *(uint32_t*)0x20000084 = 0; *(uint32_t*)0x20000088 = 0x20000040; *(uint32_t*)0x20000040 = 0x200000c0; *(uint32_t*)0x200000c0 = 0x44; *(uint8_t*)0x200000c4 = 0xa; *(uint8_t*)0x200000c5 = 6; *(uint16_t*)0x200000c6 = 0x301; *(uint32_t*)0x200000c8 = 0; *(uint32_t*)0x200000cc = 0; *(uint8_t*)0x200000d0 = 0; *(uint8_t*)0x200000d1 = 0; *(uint16_t*)0x200000d2 = htobe16(0); *(uint16_t*)0x200000d4 = 9; *(uint16_t*)0x200000d6 = 2; memcpy((void*)0x200000d8, "syz1\000", 5); *(uint16_t*)0x200000e0 = 5; *(uint16_t*)0x200000e2 = 1; *(uint8_t*)0x200000e4 = 7; *(uint16_t*)0x200000e8 = 0x1c; STORE_BY_BITMASK(uint16_t, , 0x200000ea, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200000eb, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200000eb, 1, 7, 1); *(uint16_t*)0x200000ec = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200000ee, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200000ef, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200000ef, 1, 7, 1); *(uint16_t*)0x200000f0 = 8; STORE_BY_BITMASK(uint16_t, , 0x200000f2, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200000f3, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200000f3, 0, 7, 1); *(uint32_t*)0x200000f4 = htobe32(0); *(uint16_t*)0x200000f8 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200000fa, 2, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200000fb, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200000fb, 1, 7, 1); *(uint16_t*)0x200000fc = 8; STORE_BY_BITMASK(uint16_t, , 0x200000fe, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200000ff, 1, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200000ff, 0, 7, 1); *(uint32_t*)0x20000100 = htobe32(0); *(uint32_t*)0x20000044 = 0x44; *(uint32_t*)0x2000008c = 1; *(uint32_t*)0x20000090 = 0; *(uint32_t*)0x20000094 = 0; *(uint32_t*)0x20000098 = 0; syscall(__NR_sendmsg, (intptr_t)r[1], 0x20000080, 0); return 0; }