// https://syzkaller.appspot.com/bug?id=dbc4b7477e5bcbe44affe2a2bfbaa0dc9a69cfb2 // 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(0); *(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*)0x200000c0 = 0; *(uint32_t*)0x200000c4 = 0; *(uint32_t*)0x200000c8 = 0x20000080; *(uint32_t*)0x20000080 = 0x20000040; *(uint32_t*)0x20000040 = 0x28; *(uint8_t*)0x20000044 = 8; *(uint8_t*)0x20000045 = 6; *(uint16_t*)0x20000046 = 0x101; *(uint32_t*)0x20000048 = 0; *(uint32_t*)0x2000004c = 0; *(uint8_t*)0x20000050 = 0xa; *(uint8_t*)0x20000051 = 0; *(uint16_t*)0x20000052 = htobe16(0); *(uint16_t*)0x20000054 = 5; *(uint16_t*)0x20000056 = 1; *(uint8_t*)0x20000058 = 7; *(uint16_t*)0x2000005c = 9; *(uint16_t*)0x2000005e = 2; memcpy((void*)0x20000060, "syz1\000", 5); *(uint32_t*)0x20000084 = 0x28; *(uint32_t*)0x200000cc = 1; *(uint32_t*)0x200000d0 = 0; *(uint32_t*)0x200000d4 = 0; *(uint32_t*)0x200000d8 = 0x5c6e364; syscall(__NR_sendmsg, (intptr_t)r[1], 0x200000c0, 0x80); return 0; }