From 26a13b3872cf54f3e68ec48a93c9866423fc3304 Mon Sep 17 00:00:00 2001 From: Nick Cano Date: Thu, 18 Aug 2022 13:02:18 -0700 Subject: sys/fuchsia: update system calls for bti, cache, iommu, pmt, and process (#3321) Co-authored-by: Nick Cano --- sys/fuchsia/bti.txt | 17 +++++++++++++++++ sys/fuchsia/cache.txt | 10 ++++++++++ sys/fuchsia/ddk.txt | 4 ---- sys/fuchsia/iommu.txt | 12 ++++++++++++ sys/fuchsia/pmt.txt | 10 ++++++++++ sys/fuchsia/process.txt | 22 ++++++++++++++++++++++ sys/fuchsia/processes.txt | 13 ------------- 7 files changed, 71 insertions(+), 17 deletions(-) create mode 100644 sys/fuchsia/bti.txt create mode 100644 sys/fuchsia/cache.txt create mode 100644 sys/fuchsia/iommu.txt create mode 100644 sys/fuchsia/pmt.txt create mode 100644 sys/fuchsia/process.txt delete mode 100644 sys/fuchsia/processes.txt (limited to 'sys/fuchsia') diff --git a/sys/fuchsia/bti.txt b/sys/fuchsia/bti.txt new file mode 100644 index 000000000..c8cccb0c8 --- /dev/null +++ b/sys/fuchsia/bti.txt @@ -0,0 +1,17 @@ +# Copyright 2022 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +# See: https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/vdso/bti.fidl + +include + +resource zx_bti[zx_handle] + +zx_bti_create(iommu zx_iommu, options flags[bti_create_options], bti_id int64, bti ptr[out, zx_bti]) + +zx_bti_pin(handle zx_bti, options flags[bti_pin_options], vmo zx_vmo, offset int64, size int64, addrs ptr[out, array[intptr]], num_addrs len[addrs], pmt ptr[out, zx_pmt]) + +zx_bti_release_quarantine(bti zx_bti) + +bti_create_options = 0 +bti_pin_options = ZX_BTI_PERM_READ, ZX_BTI_PERM_WRITE, ZX_BTI_PERM_EXECUTE, ZX_BTI_COMPRESS, ZX_BTI_CONTIGUOUS diff --git a/sys/fuchsia/cache.txt b/sys/fuchsia/cache.txt new file mode 100644 index 000000000..e6e750d09 --- /dev/null +++ b/sys/fuchsia/cache.txt @@ -0,0 +1,10 @@ +# Copyright 2022 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +# See: https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/vdso/cache.fidl + +include + +zx_cache_flush(addr ptr[in, array[int8]], size len[addr], options flags[cache_flush_options]) + +cache_flush_options = ZX_CACHE_FLUSH_DATA, ZX_CACHE_FLUSH_INVALIDATE, ZX_CACHE_FLUSH_INSN diff --git a/sys/fuchsia/ddk.txt b/sys/fuchsia/ddk.txt index 2bc278136..9a886b1d6 100644 --- a/sys/fuchsia/ddk.txt +++ b/sys/fuchsia/ddk.txt @@ -3,7 +3,3 @@ include include - -cache_flush_flags = ZX_CACHE_FLUSH_DATA, ZX_CACHE_FLUSH_INVALIDATE, ZX_CACHE_FLUSH_INSN - -zx_cache_flush(addr ptr[out, intptr], size int64, flags flags[cache_flush_flags]) diff --git a/sys/fuchsia/iommu.txt b/sys/fuchsia/iommu.txt new file mode 100644 index 000000000..f6bcffbbf --- /dev/null +++ b/sys/fuchsia/iommu.txt @@ -0,0 +1,12 @@ +# Copyright 2022 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +# See: https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/vdso/iommu.fidl + +include + +resource zx_iommu[zx_handle] + +zx_iommu_create(handle zx_handle, type flags[iommu_create_type], desc ptr[in, array[int8]], size len[desc], out_handle ptr[out, zx_iommu]) + +iommu_create_type = ZX_IOMMU_TYPE_DUMMY diff --git a/sys/fuchsia/pmt.txt b/sys/fuchsia/pmt.txt new file mode 100644 index 000000000..7bdd65643 --- /dev/null +++ b/sys/fuchsia/pmt.txt @@ -0,0 +1,10 @@ +# Copyright 2022 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +# See: https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/vdso/pmt.fidl + +include + +resource zx_pmt[zx_handle] + +zx_pmt_unpin(handle zx_pmt) diff --git a/sys/fuchsia/process.txt b/sys/fuchsia/process.txt new file mode 100644 index 000000000..c4e57d175 --- /dev/null +++ b/sys/fuchsia/process.txt @@ -0,0 +1,22 @@ +# Copyright 2022 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +# See: https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/vdso/process.fidl + +include + +resource zx_process[zx_handle] + +zx_process_exit(ret_code int64) + +zx_process_create(job zx_job, name ptr[in, string], name_len len[name], options const[0], proc_handle ptr[out, zx_process], vmar_handle ptr[out, zx_vmar]) + +zx_process_start$allargs(proc_handle zx_process, thread_handle zx_thread, entry ptr[in, text[target]], stack intptr, arg1 zx_handle, arg2 intptr) + +zx_process_start$arg1(proc_handle zx_process, thread_handle zx_thread, entry ptr[in, text[target]], stack intptr, arg1 zx_handle, arg2 const[0]) + +zx_process_start$arg2(proc_handle zx_process, thread_handle zx_thread, entry ptr[in, text[target]], stack intptr, arg1 const[0], arg2 intptr) + +zx_process_read_memory(proc_handle zx_process, vaddr intptr, buffer ptr[out, array[int8]], size len[buffer], actual ptr[out, int64]) + +zx_process_write_memory(proc_handle zx_process, vaddr intptr, buffer ptr[in, array[int8]], size len[buffer], actual ptr[out, int64]) diff --git a/sys/fuchsia/processes.txt b/sys/fuchsia/processes.txt deleted file mode 100644 index e6e6b9367..000000000 --- a/sys/fuchsia/processes.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2017 syzkaller project authors. All rights reserved. -# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -include - -resource zx_process[zx_task] - -zx_process_create(job zx_job, name ptr[in, string], name_len len[name], options const[0], proc_handle ptr[out, zx_process], vmar_handle ptr[out, zx_vmar]) -zx_process_read_memory(process zx_process, vaddr ptr[out, int8], buffer ptr[out, array[int8]], len len[buffer], actual ptr[out, intptr]) -zx_process_start(process zx_process, thread zx_thread, entry ptr[in, text[target]], stack ptr[out, array[int8]], arg1 const[0], arg2 const[0]) -# TODO: temporary disabled as it crashes kernel left and right. -# zx_process_write_memory(process zx_process, vaddr ptr[out, int8], buffer ptr[in, array[int8]], len len[buffer], actual ptr[out, intptr]) -zx_process_exit(ret_code int64) -- cgit mrf-deployment