// https://syzkaller.appspot.com/bug?id=9f640e969e36776be02eb136b1f0a75fc6f5ed49 // 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_bpf #define __NR_bpf 321 #endif uint64_t r[1] = {0xffffffffffffffff}; 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; *(uint32_t*)0x200002c0 = 5; *(uint32_t*)0x200002c4 = 3; *(uint32_t*)0x200002c8 = 0x209e20; *(uint32_t*)0x200002cc = 1; *(uint32_t*)0x200002d0 = 1; *(uint32_t*)0x200002d4 = -1; *(uint32_t*)0x200002d8 = 0; *(uint8_t*)0x200002dc = 0; *(uint8_t*)0x200002dd = 0; *(uint8_t*)0x200002de = 0; *(uint8_t*)0x200002df = 0; *(uint8_t*)0x200002e0 = 0; *(uint8_t*)0x200002e1 = 0; *(uint8_t*)0x200002e2 = 0; *(uint8_t*)0x200002e3 = 0; *(uint8_t*)0x200002e4 = 0; *(uint8_t*)0x200002e5 = 0; *(uint8_t*)0x200002e6 = 0; *(uint8_t*)0x200002e7 = 0; *(uint8_t*)0x200002e8 = 0; *(uint8_t*)0x200002e9 = 0; *(uint8_t*)0x200002ea = 0; *(uint8_t*)0x200002eb = 0; *(uint32_t*)0x200002ec = 0; *(uint32_t*)0x200002f0 = -1; *(uint32_t*)0x200002f4 = 0; *(uint32_t*)0x200002f8 = 0; *(uint32_t*)0x200002fc = 0; res = syscall(__NR_bpf, 0ul, 0x200002c0ul, 0x40ul); if (res != -1) r[0] = res; *(uint32_t*)0x20000240 = 0x11; *(uint32_t*)0x20000244 = 0xd; *(uint64_t*)0x20000248 = 0x20000300; *(uint8_t*)0x20000300 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000301, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000301, 0, 4, 4); *(uint16_t*)0x20000302 = 0; *(uint32_t*)0x20000304 = 0x7f80000; *(uint8_t*)0x20000308 = 0; *(uint8_t*)0x20000309 = 0; *(uint16_t*)0x2000030a = 0; *(uint32_t*)0x2000030c = 1; *(uint8_t*)0x20000310 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000311, 5, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000311, 2, 4, 4); *(uint16_t*)0x20000312 = 0; *(uint32_t*)0x20000314 = r[0]; *(uint8_t*)0x20000318 = 0; *(uint8_t*)0x20000319 = 0; *(uint16_t*)0x2000031a = 0; *(uint32_t*)0x2000031c = 2; *(uint8_t*)0x20000320 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000321, 0xa, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000321, 2, 4, 4); *(uint16_t*)0x20000322 = 0; *(uint32_t*)0x20000324 = -1; *(uint8_t*)0x20000328 = 0; *(uint8_t*)0x20000329 = 0; *(uint16_t*)0x2000032a = 0; *(uint32_t*)0x2000032c = 1; *(uint8_t*)0x20000330 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000331, 5, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000331, 3, 4, 4); *(uint16_t*)0x20000332 = 0; *(uint32_t*)0x20000334 = 1; *(uint8_t*)0x20000338 = 0; *(uint8_t*)0x20000339 = 0; *(uint16_t*)0x2000033a = 0; *(uint32_t*)0x2000033c = 0; *(uint8_t*)0x20000340 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x20000341, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000341, 0, 4, 4); *(uint16_t*)0x20000342 = 0; *(uint32_t*)0x20000344 = 0xd8d; *(uint8_t*)0x20000348 = 0; *(uint8_t*)0x20000349 = 0; *(uint16_t*)0x2000034a = 0; *(uint32_t*)0x2000034c = 0x20; STORE_BY_BITMASK(uint8_t, , 0x20000350, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x20000350, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x20000350, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x20000351, 9, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x20000351, 4, 4, 4); *(uint16_t*)0x20000352 = 0xffe0; *(uint32_t*)0x20000354 = 4; *(uint8_t*)0x20000358 = 0x95; *(uint8_t*)0x20000359 = 0; *(uint16_t*)0x2000035a = 0; *(uint32_t*)0x2000035c = 0; *(uint8_t*)0x20000360 = 0x95; *(uint8_t*)0x20000361 = 0; *(uint16_t*)0x20000362 = 0; *(uint32_t*)0x20000364 = 0; *(uint64_t*)0x20000250 = 0x20000040; memcpy((void*)0x20000040, "GPL\000", 4); *(uint32_t*)0x20000258 = 4; *(uint32_t*)0x2000025c = 0x9c; *(uint64_t*)0x20000260 = 0x20000140; *(uint32_t*)0x20000268 = 0x40f00; *(uint32_t*)0x2000026c = 0; *(uint8_t*)0x20000270 = 0; *(uint8_t*)0x20000271 = 0; *(uint8_t*)0x20000272 = 0; *(uint8_t*)0x20000273 = 0; *(uint8_t*)0x20000274 = 0; *(uint8_t*)0x20000275 = 0; *(uint8_t*)0x20000276 = 0; *(uint8_t*)0x20000277 = 0; *(uint8_t*)0x20000278 = 0; *(uint8_t*)0x20000279 = 0; *(uint8_t*)0x2000027a = 0; *(uint8_t*)0x2000027b = 0; *(uint8_t*)0x2000027c = 0; *(uint8_t*)0x2000027d = 0; *(uint8_t*)0x2000027e = 0; *(uint8_t*)0x2000027f = 0; *(uint32_t*)0x20000280 = 0; *(uint32_t*)0x20000284 = 0; *(uint32_t*)0x20000288 = -1; *(uint32_t*)0x2000028c = 8; *(uint64_t*)0x20000290 = 0; *(uint32_t*)0x20000298 = 0; *(uint32_t*)0x2000029c = 0x10; *(uint64_t*)0x200002a0 = 0; *(uint32_t*)0x200002a8 = 0; *(uint32_t*)0x200002ac = 0; *(uint32_t*)0x200002b0 = 0; syscall(__NR_bpf, 5ul, 0x20000240ul, 0x78ul); return 0; }