// https://syzkaller.appspot.com/bug?id=565fa40a59038b0dd66d10e45f657e5d063d408a // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #ifndef __NR_ioctl #define __NR_ioctl 29 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_openat #define __NR_openat 56 #endif uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // openat$udambuf arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 75 64 6d 61 62 75 66 00} (length 0xd) // } // flags: const = 0x2 (4 bytes) // ] // returns fd_udambuf memcpy((void*)0x20000000, "/dev/udmabuf\000", 13); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x20000000ul, /*flags=*/2, 0); if (res != -1) r[0] = res; // ioctl$UDMABUF_CREATE_LIST arguments: [ // fd: fd_udambuf (resource) // cmd: const = 0x40087543 (4 bytes) // arg: ptr[in, udmabuf_create_list] { // udmabuf_create_list { // flags: int32 = 0x0 (4 bytes) // count: len = 0x2 (4 bytes) // list: array[udmabuf_create_item] { // udmabuf_create_item { // memfd: fd_memfd (resource) // __pad: const = 0x0 (4 bytes) // offset: udmabuf_offset_size = 0x1000000 (8 bytes) // size: udmabuf_offset_size = 0x1000000000000 (8 bytes) // } // udmabuf_create_item { // memfd: fd_memfd (resource) // __pad: const = 0x0 (4 bytes) // offset: udmabuf_offset_size = 0x0 (8 bytes) // size: udmabuf_offset_size = 0x1000000 (8 bytes) // } // } // } // } // ] // returns fd_dma_buf *(uint32_t*)0x20000080 = 0; *(uint32_t*)0x20000084 = 2; *(uint32_t*)0x20000088 = -1; *(uint32_t*)0x2000008c = 0; *(uint64_t*)0x20000090 = 0x1000000; *(uint64_t*)0x20000098 = 0x1000000000000; *(uint32_t*)0x200000a0 = -1; *(uint32_t*)0x200000a4 = 0; *(uint64_t*)0x200000a8 = 0; *(uint64_t*)0x200000b0 = 0x1000000; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x40087543, /*arg=*/0x20000080ul); return 0; }