// https://syzkaller.appspot.com/bug?id=d3e123ed5565d772a37a9d799f8e09eb5a47366d // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include const int kInitNetNsFd = 201; static long syz_init_net_socket(volatile long domain, volatile long type, volatile long proto) { return syscall(__NR_socket, domain, type, proto); } uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } syscall(__NR_setfsuid, /*fsuid=*/0); syscall(__NR_lchown, /*file=*/0ul, /*uid=*/0, /*gid=*/0xee01); syscall(__NR_sendmsg, /*fd=*/-1, /*msg=*/0ul, /*f=*/0ul); res = -1; res = syz_init_net_socket(/*fam=*/0x1f, /*type=SOCK_SEQPACKET*/ 5, /*proto=*/0); if (res != -1) r[0] = res; memcpy((void*)0x20000040, "wlan0\000\000\000\000\000\000\000\000\000\000\000", 16); syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x8b30, /*arg=*/0x20000040ul); return 0; }