From 2353a3ec6e28d26c020ea7176d16d8fafb772e24 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 20 Oct 2021 10:44:58 -0400 Subject: sys/freebsd: add procctl(2) definitions --- sys/freebsd/procctl.txt | 71 +++++++++++++++++++++++++++++++++++++++++++ sys/freebsd/procctl.txt.const | 27 ++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 sys/freebsd/procctl.txt create mode 100644 sys/freebsd/procctl.txt.const diff --git a/sys/freebsd/procctl.txt b/sys/freebsd/procctl.txt new file mode 100644 index 000000000..64474a6ce --- /dev/null +++ b/sys/freebsd/procctl.txt @@ -0,0 +1,71 @@ +# Copyright 2021 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 +include +include + +procctl$PROC_SPROTECT(idtype flags[idtype], id pid, cmd const[PROC_SPROTECT], data ptr[in, int32]) + +procctl$PROC_REAP_ACQUIRE(idtype flags[idtype], id pid, cmd const[PROC_REAP_ACQUIRE], data const[0]) +procctl$PROC_REAP_RELEASE(idtype flags[idtype], id pid, cmd const[PROC_REAP_RELEASE], data const[0]) +procctl$PROC_REAP_STATUS(idtype flags[idtype], id pid, cmd const[PROC_REAP_STATUS], data ptr[out, reaper_status]) +procctl$PROC_REAP_GETPIDS(idtype flags[idtype], id pid, cmd const[PROC_REAP_GETPIDS], data ptr[in, reaper_pids]) +procctl$PROC_REAP_KILL(idtype flags[idtype], id pid, cmd const[PROC_REAP_KILL], data ptr[inout, reaper_kill]) + +reaper_status { + flags int32 + children int32 + descendants int32 + reaper pid + pid pid + pad array[const[0, int32], 15] +} + +reaper_pidinfo { + pid pid + subtree pid + flags int32 + pad array[const[0, int32], 15] +} + +reaper_pids { + count len[pids, int32] + pad array[const[0, int32], 15] + pids ptr[in, array[reaper_pidinfo]] +} + +reaper_kill { + sig int32 + flags int32 + subtree pid + killed int32 + fpid pid + pad array[const[0, int32], 15] +} + +procctl$PROC_TRACE_CTL(idtype flags[idtype], id pid, cmd const[PROC_TRACE_CTL], data ptr[in, int32]) +procctl$PROC_TRACE_STATUS(idtype flags[idtype], id pid, cmd const[PROC_TRACE_STATUS], data ptr[out, int32]) + +procctl$PROC_TRAPCAP_CTL(idtype flags[idtype], id pid, cmd const[PROC_TRAPCAP_CTL], data ptr[in, int32]) +procctl$PROC_TRAPCAP_STATUS(idtype flags[idtype], id pid, cmd const[PROC_TRAPCAP_STATUS], data ptr[out, int32]) + +procctl$PROC_PDEATHSIG_CTL(idtype flags[idtype], id pid, cmd const[PROC_PDEATHSIG_CTL], data ptr[in, int32]) +procctl$PROC_PDEATHSIG_STATUS(idtype flags[idtype], id pid, cmd const[PROC_PDEATHSIG_STATUS], data ptr[out, int32]) + +procctl$PROC_ASLR_CTL(idtype flags[idtype], id pid, cmd const[PROC_ASLR_CTL], data ptr[in, int32]) +procctl$PROC_ASLR_STATUS(idtype flags[idtype], id pid, cmd const[PROC_ASLR_STATUS], data ptr[out, int32]) + +procctl$PROC_PROTMAX_CTL(idtype flags[idtype], id pid, cmd const[PROC_PROTMAX_CTL], data ptr[in, int32]) +procctl$PROC_PROTMAX_STATUS(idtype flags[idtype], id pid, cmd const[PROC_PROTMAX_STATUS], data ptr[out, int32]) + +procctl$PROC_STACKGAP_CTL(idtype flags[idtype], id pid, cmd const[PROC_STACKGAP_CTL], data ptr[in, int32]) +procctl$PROC_STACKGAP_STATUS(idtype flags[idtype], id pid, cmd const[PROC_STACKGAP_STATUS], data ptr[out, int32]) + +procctl$PROC_NO_NEW_PRIVS_CTL(idtype flags[idtype], id pid, cmd const[PROC_NO_NEW_PRIVS_CTL], data ptr[in, int32]) +procctl$PROC_NO_NEW_PRIVS_STATUS(idtype flags[idtype], id pid, cmd const[PROC_NO_NEW_PRIVS_STATUS], data ptr[out, int32]) + +procctl$PROC_WXMAP_CTL(idtype flags[idtype], id pid, cmd const[PROC_WXMAP_CTL], data ptr[in, int32]) +procctl$PROC_WXMAP_STATUS(idtype flags[idtype], id pid, cmd const[PROC_WXMAP_STATUS], data ptr[out, int32]) + +idtype = P_PID, P_PGID diff --git a/sys/freebsd/procctl.txt.const b/sys/freebsd/procctl.txt.const new file mode 100644 index 000000000..9d2bf6883 --- /dev/null +++ b/sys/freebsd/procctl.txt.const @@ -0,0 +1,27 @@ +# Code generated by syz-sysgen. DO NOT EDIT. +arches = 386, amd64 +PROC_ASLR_CTL = 13 +PROC_ASLR_STATUS = 14 +PROC_NO_NEW_PRIVS_CTL = 19 +PROC_NO_NEW_PRIVS_STATUS = 20 +PROC_PDEATHSIG_CTL = 11 +PROC_PDEATHSIG_STATUS = 12 +PROC_PROTMAX_CTL = 15 +PROC_PROTMAX_STATUS = 16 +PROC_REAP_ACQUIRE = 2 +PROC_REAP_GETPIDS = 5 +PROC_REAP_KILL = 6 +PROC_REAP_RELEASE = 3 +PROC_REAP_STATUS = 4 +PROC_SPROTECT = 1 +PROC_STACKGAP_CTL = 17 +PROC_STACKGAP_STATUS = 18 +PROC_TRACE_CTL = 7 +PROC_TRACE_STATUS = 8 +PROC_TRAPCAP_CTL = 9 +PROC_TRAPCAP_STATUS = 10 +PROC_WXMAP_CTL = 21 +PROC_WXMAP_STATUS = 22 +P_PGID = 2 +P_PID = 0 +SYS_procctl = 544 -- cgit mrf-deployment