// https://syzkaller.appspot.com/bug?id=e5054b48470ac0510465d011d8bb2bb72669e41a // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_close #define __NR_close 6 #endif #ifndef __NR_mmap #define __NR_mmap 192 #endif #ifndef __NR_openat #define __NR_openat 295 #endif #ifndef __NR_pipe #define __NR_pipe 42 #endif #ifndef __NR_read #define __NR_read 3 #endif #ifndef __NR_splice #define __NR_splice 313 #endif #ifndef __NR_vmsplice #define __NR_vmsplice 316 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); intptr_t res = 0; res = syscall(__NR_pipe, 0x20000080); if (res != -1) { r[0] = *(uint32_t*)0x20000080; r[1] = *(uint32_t*)0x20000084; } *(uint32_t*)0x200000c0 = 0x20000180; memcpy((void*)0x20000180, "\x77\x69\x0a\xdd\xcf\xbe\x1f\xbb\x66\xec", 10); *(uint32_t*)0x200000c4 = 0xff3b; syscall(__NR_vmsplice, (intptr_t)r[1], 0x200000c0, 1, 1); syscall(__NR_close, (intptr_t)r[1]); memcpy((void*)0x20000000, "/sys/kernel/debug/bluetooth/6lowpan_enable\000", 43); res = syscall(__NR_openat, 0xffffff9c, 0x20000000, 2, 0); if (res != -1) r[2] = res; syscall(__NR_splice, (intptr_t)r[0], 0, (intptr_t)r[2], 0, 0x10001, 0xa); syscall(__NR_read, (intptr_t)r[1], 0, 0); return 0; }