diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-09-18 17:38:12 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-09-19 08:37:17 +0000 |
| commit | 52c1f8045c38bcce0229b2cc3c69b1cbe21eb629 (patch) | |
| tree | 6795b28e4d5cf644369433d5e1906fbf1bfe7e1b /sys/linux/binfmt.txt | |
| parent | 6d197301fe4a048a54f3203599963947b6563bd9 (diff) | |
sys/linux: add syz_create_resource
syz_create_resource allows to turn any value into a resource.
Improve binfmt descriptions using syz_create_resource:
we need to pass the same file name to write syscalls and execve.
Use syz_create_resource to improve binfmt descriptions.
Diffstat (limited to 'sys/linux/binfmt.txt')
| -rw-r--r-- | sys/linux/binfmt.txt | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/sys/linux/binfmt.txt b/sys/linux/binfmt.txt index 3e86ab61a..d0e6b7b23 100644 --- a/sys/linux/binfmt.txt +++ b/sys/linux/binfmt.txt @@ -3,15 +3,33 @@ include <uapi/linux/a.out.h> include <uapi/linux/elf.h> +include <linux/fcntl.h> -execve(file ptr[in, filename], argv ptr[in, array[ptr[in, string]]], envp ptr[in, array[ptr[in, string]]]) -execveat(dirfd fd_dir, file ptr[in, filename], argv ptr[in, array[ptr[in, string]]], envp ptr[in, array[ptr[in, string]]], flags flags[at_flags]) +resource fd_binfmt[fd] +resource ptr_binfmt_file[intptr] -write$binfmt_script(fd fd, data ptr[in, binfmt_script], len bytesize[data]) -write$binfmt_misc(fd fd, data ptr[in, binfmt_misc], len bytesize[data]) -write$binfmt_aout(fd fd, data ptr[in, binfmt_aout], len bytesize[data]) -write$binfmt_elf32(fd fd, data ptr[in, binfmt_elf32], len bytesize[data]) -write$binfmt_elf64(fd fd, data ptr[in, binfmt_elf64], len bytesize[data]) +syz_create_resource$binfmt(file ptr[in, filename]) ptr_binfmt_file + +execve(file ptr[in, filename], argv ptr[in, argv_array], envp ptr[in, argv_array]) +execveat(dirfd fd_dir, file ptr[in, filename], argv ptr[in, argv_array], envp ptr[in, argv_array], flags flags[at_flags]) +execveat$binfmt(dirfd fd_dir, file ptr_binfmt_file, argv ptr[in, argv_array], envp ptr[in, argv_array], flags flags[at_flags]) + +openat$binfmt(fd const[AT_FDCWD], file ptr_binfmt_file, flags const[BINFMT_OPEN_FLAGS], mode const[0x1ff]) fd_binfmt + +write$binfmt_script(fd fd_binfmt, data ptr[in, binfmt_script], len bytesize[data]) +write$binfmt_misc(fd fd_binfmt, data ptr[in, binfmt_misc], len bytesize[data]) +write$binfmt_aout(fd fd_binfmt, data ptr[in, binfmt_aout], len bytesize[data]) +write$binfmt_elf32(fd fd_binfmt, data ptr[in, binfmt_elf32], len bytesize[data]) +write$binfmt_elf64(fd fd_binfmt, data ptr[in, binfmt_elf64], len bytesize[data]) + +close$binfmt(fd fd_binfmt) + +define BINFMT_OPEN_FLAGS O_WRONLY | O_CREAT + +argv_array { + args array[ptr[in, string]] + z const[0, intptr] +} [packed] binfmt_script { hdr stringnoz["#! "] |
