diff options
| author | Hrutvik Kanabar <hrutvik@google.com> | 2022-10-25 10:13:51 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-11-21 11:06:14 +0100 |
| commit | d0405298b24db0e2a6b2abfdc8c7e5ebbe49d1a0 (patch) | |
| tree | c022669ce377e0c09376d60b45a01584c67c0989 /docs/syscall_descriptions_syntax.md | |
| parent | 7954d07c228dd9ce63b7ebd13239b4d1f2c35233 (diff) | |
prog, pkg/compiler: add `BufferCompressed` buffer type & `compressed_image` builtin
Create the `BufferCompressed` kind of `BufferType`, which will be used
to represent compressed data. Create the corresponding `compressed_image`
syzlang builtin, which is backed by `BufferCompressed`. For now, no
syscalls use this feature - this will be introduced in future commits.
We have to be careful to decompress the data before mutating, and
re-compress before storing. We make sure that any deserialised
`BufferCompressed` data is valid too.
`BufferCompressed` arguments are mutated using a generic heatmap. In
future, we could add variants of `BufferCompressed` or populate the
`BufferType` sub-kind, using it to choose different kinds of heatmap for
different uncompressed data formats.
Various operations on compressed data must be forbidden, so we check for
`BufferCompressed` in key places. We also have to ensure `compressed_image`
can only be used in syscalls that are marked `no_{generate,minimize}`.
Therefore, we add a generic compiler check which allows type
descriptions to require attributes on the syscalls which use them.
Diffstat (limited to 'docs/syscall_descriptions_syntax.md')
| -rw-r--r-- | docs/syscall_descriptions_syntax.md | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index 1fe61343e..6d2e28273 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -10,7 +10,8 @@ argname = identifier type = typename [ "[" type-options "]" ] typename = "const" | "intN" | "intptr" | "flags" | "array" | "ptr" | "string" | "strconst" | "filename" | "glob" | "len" | - "bytesize" | "bytesizeN" | "bitsize" | "vma" | "proc" + "bytesize" | "bytesizeN" | "bitsize" | "vma" | "proc" | + "compressed_image" type-options = [type-opt ["," type-opt]] ``` @@ -62,6 +63,9 @@ rest of the type-options are type-specific: vma64 has size of 8 bytes regardless of target pointer size "proc": per process int (see description below), type-options: value range start, how many values per process, underlying type +"compressed_image": zlib-compressed disk image + syscalls accepting compressed images must be marked with `no_generate` + and `no_minimize` call attributes. "text": machine code of the specified type, type-options: text type (x86_real, x86_16, x86_32, x86_64, arm64) "void": type with static size 0 |
