// https://syzkaller.appspot.com/bug?id=39b68c43af9a942b5f80a2e199155e45f5b8b53b // 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)))) 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); *(uint32_t*)0x20000440 = 2; *(uint32_t*)0x20000444 = 0x70; *(uint8_t*)0x20000448 = 0x1e; *(uint8_t*)0x20000449 = 1; *(uint8_t*)0x2000044a = 0; *(uint8_t*)0x2000044b = 0; *(uint32_t*)0x2000044c = 0; *(uint64_t*)0x20000450 = 0; *(uint64_t*)0x20000458 = 0; *(uint64_t*)0x20000460 = 0; STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 0, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 1, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 2, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 3, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 4, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 5, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 6, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 7, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 8, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 9, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 10, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 11, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 12, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 13, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 14, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 15, 2); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 17, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 18, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 19, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 20, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 21, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 22, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 23, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 24, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 25, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 26, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 27, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 28, 1); STORE_BY_BITMASK(uint64_t, , 0x20000468, 0, 29, 35); *(uint32_t*)0x20000470 = 0; *(uint32_t*)0x20000474 = 0; *(uint64_t*)0x20000478 = 0; *(uint64_t*)0x20000480 = 0; *(uint64_t*)0x20000488 = 0; *(uint64_t*)0x20000490 = 0; *(uint32_t*)0x20000498 = 0; *(uint32_t*)0x2000049c = 0; *(uint64_t*)0x200004a0 = 0; *(uint32_t*)0x200004a8 = 0; *(uint16_t*)0x200004ac = 0; *(uint16_t*)0x200004ae = 0; syscall(__NR_perf_event_open, 0x20000440ul, 0, 0ul, -1, 0ul); memcpy((void*)0x20000080, "./file0\000", 8); syscall(__NR_mkdir, 0x20000080ul, 0ul); memcpy((void*)0x20000240, "/dev/loop", 9); *(uint8_t*)0x20000249 = 0x30; *(uint8_t*)0x2000024a = 0; memcpy((void*)0x200001c0, "./file0\000", 8); memcpy((void*)0x20000400, "xfs\000", 4); syscall(__NR_mount, 0x20000240ul, 0x200001c0ul, 0x20000400ul, 0x1400084ul, 0ul); return 0; }