diff options
| author | Alexander Potapenko <glider@google.com> | 2025-10-14 13:20:39 +0200 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2025-10-17 06:51:20 +0000 |
| commit | e18aa5057febfc3f9f61c8755234e361528def0e (patch) | |
| tree | 49bb7b0dd0b2841fca59d6eb23f49818332cdf81 /executor/common_kvm_arm64_syzos.h | |
| parent | bc0cbe5709e294d9755f481e7f41be68413e14f9 (diff) | |
executor: introduce __addrspace_guest
Apply __addrspace_guest to every guest function and use a C++ template
to statically validate that host functions are not passed to
executor_fn_guest_addr().
This only works in Clang builds of syz-executor, because GCC does not
support address spaces, and C reproducers cannot use templates.
The static check allows us to drop the dynamic checks in DEFINE_GUEST_FN_TO_GPA_FN().
While at it, replace DEFINE_GUEST_FN_TO_GPA_FN() with explicit declarations of
host_fn_guest_addr() and guest_fn_guest_addr().
Diffstat (limited to 'executor/common_kvm_arm64_syzos.h')
| -rw-r--r-- | executor/common_kvm_arm64_syzos.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/executor/common_kvm_arm64_syzos.h b/executor/common_kvm_arm64_syzos.h index 2dd00a146..0a9e3391f 100644 --- a/executor/common_kvm_arm64_syzos.h +++ b/executor/common_kvm_arm64_syzos.h @@ -89,18 +89,18 @@ struct api_call_its_send_cmd { uint32 cpuid2; }; -static void guest_uexit(uint64 exit_code); -static void guest_execute_code(uint32* insns, uint64 size); -static void guest_handle_mrs(uint64 reg); -static void guest_handle_msr(uint64 reg, uint64 val); -static void guest_handle_smc(struct api_call_smccc* cmd); -static void guest_handle_hvc(struct api_call_smccc* cmd); -static void guest_handle_svc(struct api_call_smccc* cmd); -static void guest_handle_eret(uint64 unused); -static void guest_handle_irq_setup(struct api_call_irq_setup* cmd); -static void guest_handle_memwrite(struct api_call_memwrite* cmd); -static void guest_handle_its_setup(struct api_call_3* cmd); -static void guest_handle_its_send_cmd(struct api_call_its_send_cmd* cmd); +GUEST_CODE static void guest_uexit(uint64 exit_code); +GUEST_CODE static void guest_execute_code(uint32* insns, uint64 size); +GUEST_CODE static void guest_handle_mrs(uint64 reg); +GUEST_CODE static void guest_handle_msr(uint64 reg, uint64 val); +GUEST_CODE static void guest_handle_smc(struct api_call_smccc* cmd); +GUEST_CODE static void guest_handle_hvc(struct api_call_smccc* cmd); +GUEST_CODE static void guest_handle_svc(struct api_call_smccc* cmd); +GUEST_CODE static void guest_handle_eret(uint64 unused); +GUEST_CODE static void guest_handle_irq_setup(struct api_call_irq_setup* cmd); +GUEST_CODE static void guest_handle_memwrite(struct api_call_memwrite* cmd); +GUEST_CODE static void guest_handle_its_setup(struct api_call_3* cmd); +GUEST_CODE static void guest_handle_its_send_cmd(struct api_call_its_send_cmd* cmd); typedef enum { UEXIT_END = (uint64)-1, |
