diff options
| author | Alexander Potapenko <glider@google.com> | 2026-01-13 15:31:44 +0100 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2026-01-14 07:29:47 +0000 |
| commit | 1b03c2cc6e672ed19398ca4a9ce22da45299e68a (patch) | |
| tree | d56bfb9f8f65822cd920c3ed73776d8cf28ee35a | |
| parent | 90f60a482c87f6baf11d087b0fbf141df123bc0c (diff) | |
docs: minor changes to syzos.md
Make it clearer how to add new commands.
| -rw-r--r-- | docs/syzos.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/syzos.md b/docs/syzos.md index e1306a8eb..df292ea72 100644 --- a/docs/syzos.md +++ b/docs/syzos.md @@ -165,6 +165,8 @@ Modify the architecture-specific executor header (e.g., `executor/common_kvm_amd GUEST_CODE static void guest_handle_nested_amd_vmcb_write_mask(struct api_call_5* cmd, uint64 cpu_id); ``` +Note: make sure to choose the optimal api_call_N structure that exactly matches the number of arguments required by your new primitive (e.g., use struct api_call_2 for a command needing two arguments). + ### Step 2: Implement Guest Logic and Dispatch In the same file (or corresponding source), implement the guest logic. @@ -189,6 +191,16 @@ In the same file (or corresponding source), implement the guest logic. Expose the new command to `syzkaller` in the description file (e.g., `sys/linux/dev_kvm_amd64.txt`). 1. **Define Structures:** Define any necessary constants or structures. + ``` + syzos_api_nested_amd_vmcb_write_mask { + vm_id syzos_api_vm_id + offset vmcb_offset + set_mask int64 + unset_mask int64 + flip_mask int64 + } + ``` + 2. **Map Command ID:** Add the command to the `syzos_api_call` union. **Crucial:** The ID (e.g., `380`) must match the enum in the C header. ``` syzos_api_call$x86 [ |
