From d8074e0bb985b9be6611e16b45b8657f20157a4b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 27 Sep 2019 12:59:10 +0200 Subject: [PATCH] sys/linux: add new pidfd syscalls --- executor/defs.h | 6 +++--- executor/syscalls.h | 9 +++++++++ sys/linux/gen/amd64.go | 31 ++++++++++++++++++++++++++++++- sys/linux/gen/arm64.go | 31 ++++++++++++++++++++++++++++++- sys/linux/gen/ppc64le.go | 31 ++++++++++++++++++++++++++++++- sys/linux/sys.txt | 15 +++++++++++++++ sys/linux/sys_amd64.const | 3 +++ sys/linux/sys_arm64.const | 3 +++ sys/linux/sys_ppc64le.const | 3 +++ 9 files changed, 126 insertions(+), 6 deletions(-) diff --git a/executor/defs.h b/executor/defs.h index 4e527cc1..c014c95d 100644 --- a/executor/defs.h +++ b/executor/defs.h @@ -80,7 +80,7 @@ #if GOARCH_amd64 #define GOARCH "amd64" -#define SYZ_REVISION "ff14590c1d7571c59d13695f38ba0c5a0cde1926" +#define SYZ_REVISION "2b0d730636e173a54883adbff9038bede9b4433f" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -100,7 +100,7 @@ #if GOARCH_arm64 #define GOARCH "arm64" -#define SYZ_REVISION "11f0b72f097b67e06980023b95d9661975776dcb" +#define SYZ_REVISION "4acbb2d2f22e4882fb6bf3e8cf045731ce95b94e" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -110,7 +110,7 @@ #if GOARCH_ppc64le #define GOARCH "ppc64le" -#define SYZ_REVISION "16f82b19155f760162bb4f08946191a084797f74" +#define SYZ_REVISION "49381a16fc88ae3d59f7b17b827c6eccf9284bc6" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 diff --git a/executor/syscalls.h b/executor/syscalls.h index c3f1e0ac..f250930c 100644 --- a/executor/syscalls.h +++ b/executor/syscalls.h @@ -4914,6 +4914,7 @@ const call_t syscalls[] = { {"clock_nanosleep", 230}, {"clock_settime", 227}, {"clone", 56}, + {"clone3", 435}, {"close", 3}, {"close$ibv_device", 3}, {"connect", 42}, @@ -6589,6 +6590,7 @@ const call_t syscalls[] = { {"perf_event_open", 298}, {"perf_event_open$cgroup", 298}, {"personality", 135}, + {"pidfd_open", 434}, {"pidfd_send_signal", 424}, {"pipe", 22}, {"pipe2", 293}, @@ -7393,6 +7395,7 @@ const call_t syscalls[] = { {"vmsplice", 278}, {"wait4", 61}, {"waitid", 247}, + {"waitid$P_PIDFD", 247}, {"write", 1}, {"write$9p", 1}, {"write$ALLOC_MW", 1}, @@ -10398,6 +10401,7 @@ const call_t syscalls[] = { {"clock_nanosleep", 115}, {"clock_settime", 112}, {"clone", 220}, + {"clone3", 435}, {"close", 57}, {"close$ibv_device", 57}, {"connect", 203}, @@ -12025,6 +12029,7 @@ const call_t syscalls[] = { {"perf_event_open", 241}, {"perf_event_open$cgroup", 241}, {"personality", 92}, + {"pidfd_open", 434}, {"pidfd_send_signal", 424}, {"pipe2", 59}, {"pipe2$9p", 59}, @@ -12810,6 +12815,7 @@ const call_t syscalls[] = { {"vmsplice", 75}, {"wait4", 260}, {"waitid", 95}, + {"waitid$P_PIDFD", 95}, {"write", 64}, {"write$9p", 64}, {"write$ALLOC_MW", 64}, @@ -13096,6 +13102,7 @@ const call_t syscalls[] = { {"clock_nanosleep", 248}, {"clock_settime", 245}, {"clone", 120}, + {"clone3", 435}, {"close", 6}, {"close$ibv_device", 6}, {"connect", 328}, @@ -14732,6 +14739,7 @@ const call_t syscalls[] = { {"perf_event_open", 319}, {"perf_event_open$cgroup", 319}, {"personality", 136}, + {"pidfd_open", 434}, {"pidfd_send_signal", 424}, {"pipe", 42}, {"pipe2", 317}, @@ -15533,6 +15541,7 @@ const call_t syscalls[] = { {"vmsplice", 285}, {"wait4", 114}, {"waitid", 272}, + {"waitid$P_PIDFD", 272}, {"write", 4}, {"write$9p", 4}, {"write$ALLOC_MW", 4}, diff --git a/sys/linux/gen/amd64.go b/sys/linux/gen/amd64.go index d684e189..85fc4aa7 100644 --- a/sys/linux/gen/amd64.go +++ b/sys/linux/gen/amd64.go @@ -1956,6 +1956,17 @@ var structDescs_amd64 = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "val", TypeSize: 4}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "timeout", TypeSize: 4}}}, }}}, + {Key: StructKey{Name: "clone_args"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "clone_args", TypeSize: 64}, Fields: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clone_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{256, 512, 1024, 2048, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4096}, BitMask: true}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "pidfd", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "child_tid", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "parent_tid", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "exit_signal", TypeSize: 4}}, Kind: 2, RangeEnd: 65}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "exit_signal_pad", TypeSize: 4}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "stack", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "stack_size", TypeSize: 8}}, BitSize: 8, Path: []string{"stack"}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "tls", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}}, + }}}, {Key: StructKey{Name: "close_xrcd_cmd", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "close_xrcd_cmd", TypeSize: 12, ArgDir: 2}, Fields: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "command", TypeSize: 4, ArgDir: 2}}, Val: 38}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "in_words", TypeSize: 2, ArgDir: 2}}, Val: 3}, @@ -30858,6 +30869,10 @@ var syscalls_amd64 = []*Syscall{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "childtid", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "tls", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}}, }}, + {NR: 435, Name: "clone3", CallName: "clone3", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "args", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "clone_args"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "size", TypeSize: 8}}, BitSize: 8, Path: []string{"args"}}, + }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 3, Name: "close", CallName: "close", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}}, }}, @@ -39732,6 +39747,10 @@ var syscalls_amd64 = []*Syscall{ {NR: 135, Name: "personality", CallName: "personality", Args: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "personality_flags", FldName: "persona", TypeSize: 8}}, Vals: []uint64{0, 68157441, 83886082, 100663299, 83886084, 67108869, 6, 83886087, 8, 67108873, 67108874, 67108875, 12, 67108877, 68157454, 15, 16, 262144, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728}}, }}, + {NR: 434, Name: "pidfd_open", CallName: "pidfd_open", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "pid", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}}, + }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 424, Name: "pidfd_send_signal", CallName: "pidfd_send_signal", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "fd", TypeSize: 4}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "sig", TypeSize: 4}}, Kind: 2, RangeEnd: 65}, @@ -44406,6 +44425,13 @@ var syscalls_amd64 = []*Syscall{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "wait_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1, 2, 8, 4, 2, 8, 1, 16777216, 2147483648, 1073741824, 536870912}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ru", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "rusage", Dir: 1}}}, }}, + {NR: 247, Name: "waitid$P_PIDFD", CallName: "waitid", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "which", TypeSize: 8}}, Val: 3}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "pidfd", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "infop", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "siginfo", Dir: 1}}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "wait_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1, 2, 8, 4, 2, 8, 1, 16777216, 2147483648, 1073741824, 536870912}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ru", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "rusage", Dir: 1}}}, + }}, {NR: 1, Name: "write", CallName: "write", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}}, @@ -49415,6 +49441,7 @@ var consts_amd64 = []ConstValue{ {Name: "P_ALL"}, {Name: "P_PGID", Value: 2}, {Name: "P_PID", Value: 1}, + {Name: "P_PIDFD", Value: 3}, {Name: "QMAGIC", Value: 204}, {Name: "RDMA_DRIVER_MLX5", Value: 1}, {Name: "RDMA_MAX_PRIVATE_DATA", Value: 256}, @@ -52923,6 +52950,7 @@ var consts_amd64 = []ConstValue{ {Name: "__NR_clock_nanosleep", Value: 230}, {Name: "__NR_clock_settime", Value: 227}, {Name: "__NR_clone", Value: 56}, + {Name: "__NR_clone3", Value: 435}, {Name: "__NR_close", Value: 3}, {Name: "__NR_connect", Value: 42}, {Name: "__NR_creat", Value: 85}, @@ -53072,6 +53100,7 @@ var consts_amd64 = []ConstValue{ {Name: "__NR_pause", Value: 34}, {Name: "__NR_perf_event_open", Value: 298}, {Name: "__NR_personality", Value: 135}, + {Name: "__NR_pidfd_open", Value: 434}, {Name: "__NR_pidfd_send_signal", Value: 424}, {Name: "__NR_pipe", Value: 22}, {Name: "__NR_pipe2", Value: 293}, @@ -53218,4 +53247,4 @@ var consts_amd64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_amd64 = "ff14590c1d7571c59d13695f38ba0c5a0cde1926" +const revision_amd64 = "2b0d730636e173a54883adbff9038bede9b4433f" diff --git a/sys/linux/gen/arm64.go b/sys/linux/gen/arm64.go index 6e7f7500..e58a376c 100644 --- a/sys/linux/gen/arm64.go +++ b/sys/linux/gen/arm64.go @@ -1956,6 +1956,17 @@ var structDescs_arm64 = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "val", TypeSize: 4}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "timeout", TypeSize: 4}}}, }}}, + {Key: StructKey{Name: "clone_args"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "clone_args", TypeSize: 64}, Fields: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clone_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{256, 512, 1024, 2048, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4096}, BitMask: true}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "pidfd", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "child_tid", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "parent_tid", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "exit_signal", TypeSize: 4}}, Kind: 2, RangeEnd: 65}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "exit_signal_pad", TypeSize: 4}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "stack", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "stack_size", TypeSize: 8}}, BitSize: 8, Path: []string{"stack"}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "tls", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}}, + }}}, {Key: StructKey{Name: "close_xrcd_cmd", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "close_xrcd_cmd", TypeSize: 12, ArgDir: 2}, Fields: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "command", TypeSize: 4, ArgDir: 2}}, Val: 38}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "in_words", TypeSize: 2, ArgDir: 2}}, Val: 3}, @@ -30607,6 +30618,10 @@ var syscalls_arm64 = []*Syscall{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "childtid", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "tls", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}}, }}, + {NR: 435, Name: "clone3", CallName: "clone3", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "args", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "clone_args"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "size", TypeSize: 8}}, BitSize: 8, Path: []string{"args"}}, + }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 57, Name: "close", CallName: "close", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}}, }}, @@ -39263,6 +39278,10 @@ var syscalls_arm64 = []*Syscall{ {NR: 92, Name: "personality", CallName: "personality", Args: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "personality_flags", FldName: "persona", TypeSize: 8}}, Vals: []uint64{0, 68157441, 83886082, 100663299, 83886084, 67108869, 6, 83886087, 8, 67108873, 67108874, 67108875, 12, 67108877, 68157454, 15, 16, 262144, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728}}, }}, + {NR: 434, Name: "pidfd_open", CallName: "pidfd_open", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "pid", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}}, + }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 424, Name: "pidfd_send_signal", CallName: "pidfd_send_signal", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "fd", TypeSize: 4}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "sig", TypeSize: 4}}, Kind: 2, RangeEnd: 65}, @@ -43861,6 +43880,13 @@ var syscalls_arm64 = []*Syscall{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "wait_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1, 2, 8, 4, 2, 8, 1, 16777216, 2147483648, 1073741824, 536870912}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ru", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "rusage", Dir: 1}}}, }}, + {NR: 95, Name: "waitid$P_PIDFD", CallName: "waitid", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "which", TypeSize: 8}}, Val: 3}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "pidfd", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "infop", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "siginfo", Dir: 1}}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "wait_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1, 2, 8, 4, 2, 8, 1, 16777216, 2147483648, 1073741824, 536870912}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ru", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "rusage", Dir: 1}}}, + }}, {NR: 64, Name: "write", CallName: "write", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}}, @@ -48808,6 +48834,7 @@ var consts_arm64 = []ConstValue{ {Name: "P_ALL"}, {Name: "P_PGID", Value: 2}, {Name: "P_PID", Value: 1}, + {Name: "P_PIDFD", Value: 3}, {Name: "QMAGIC", Value: 204}, {Name: "RDMA_DRIVER_MLX5", Value: 1}, {Name: "RDMA_MAX_PRIVATE_DATA", Value: 256}, @@ -52312,6 +52339,7 @@ var consts_arm64 = []ConstValue{ {Name: "__NR_clock_nanosleep", Value: 115}, {Name: "__NR_clock_settime", Value: 112}, {Name: "__NR_clone", Value: 220}, + {Name: "__NR_clone3", Value: 435}, {Name: "__NR_close", Value: 57}, {Name: "__NR_connect", Value: 203}, {Name: "__NR_delete_module", Value: 106}, @@ -52441,6 +52469,7 @@ var consts_arm64 = []ConstValue{ {Name: "__NR_openat", Value: 56}, {Name: "__NR_perf_event_open", Value: 241}, {Name: "__NR_personality", Value: 92}, + {Name: "__NR_pidfd_open", Value: 434}, {Name: "__NR_pidfd_send_signal", Value: 424}, {Name: "__NR_pipe2", Value: 59}, {Name: "__NR_pivot_root", Value: 41}, @@ -52570,4 +52599,4 @@ var consts_arm64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_arm64 = "11f0b72f097b67e06980023b95d9661975776dcb" +const revision_arm64 = "4acbb2d2f22e4882fb6bf3e8cf045731ce95b94e" diff --git a/sys/linux/gen/ppc64le.go b/sys/linux/gen/ppc64le.go index 52fc8593..8e83d774 100644 --- a/sys/linux/gen/ppc64le.go +++ b/sys/linux/gen/ppc64le.go @@ -1955,6 +1955,17 @@ var structDescs_ppc64le = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "val", TypeSize: 4}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "timeout", TypeSize: 4}}}, }}}, + {Key: StructKey{Name: "clone_args"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "clone_args", TypeSize: 64}, Fields: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clone_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{256, 512, 1024, 2048, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4096}, BitMask: true}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "pidfd", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "child_tid", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "parent_tid", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "exit_signal", TypeSize: 4}}, Kind: 2, RangeEnd: 65}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "exit_signal_pad", TypeSize: 4}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "stack", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "stack_size", TypeSize: 8}}, BitSize: 8, Path: []string{"stack"}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "tls", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}}, + }}}, {Key: StructKey{Name: "close_xrcd_cmd", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "close_xrcd_cmd", TypeSize: 12, ArgDir: 2}, Fields: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "command", TypeSize: 4, ArgDir: 2}}, Val: 38}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "in_words", TypeSize: 2, ArgDir: 2}}, Val: 3}, @@ -30514,6 +30525,10 @@ var syscalls_ppc64le = []*Syscall{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "childtid", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "tls", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}}, }}, + {NR: 435, Name: "clone3", CallName: "clone3", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "args", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "clone_args"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "size", TypeSize: 8}}, BitSize: 8, Path: []string{"args"}}, + }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 6, Name: "close", CallName: "close", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}}, }}, @@ -39195,6 +39210,10 @@ var syscalls_ppc64le = []*Syscall{ {NR: 136, Name: "personality", CallName: "personality", Args: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "personality_flags", FldName: "persona", TypeSize: 8}}, Vals: []uint64{0, 68157441, 83886082, 100663299, 83886084, 67108869, 6, 83886087, 8, 67108873, 67108874, 67108875, 12, 67108877, 68157454, 15, 16, 262144, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728}}, }}, + {NR: 434, Name: "pidfd_open", CallName: "pidfd_open", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "pid", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}}, + }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 424, Name: "pidfd_send_signal", CallName: "pidfd_send_signal", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "fd", TypeSize: 4}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "sig", TypeSize: 4}}, Kind: 2, RangeEnd: 65}, @@ -43855,6 +43874,13 @@ var syscalls_ppc64le = []*Syscall{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "wait_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1, 2, 8, 4, 2, 8, 1, 16777216, 2147483648, 1073741824, 536870912}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ru", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "rusage", Dir: 1}}}, }}, + {NR: 272, Name: "waitid$P_PIDFD", CallName: "waitid", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "which", TypeSize: 8}}, Val: 3}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "pidfd", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "infop", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "siginfo", Dir: 1}}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "wait_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1, 2, 8, 4, 2, 8, 1, 16777216, 2147483648, 1073741824, 536870912}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ru", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "rusage", Dir: 1}}}, + }}, {NR: 4, Name: "write", CallName: "write", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}}, @@ -48801,6 +48827,7 @@ var consts_ppc64le = []ConstValue{ {Name: "P_ALL"}, {Name: "P_PGID", Value: 2}, {Name: "P_PID", Value: 1}, + {Name: "P_PIDFD", Value: 3}, {Name: "QMAGIC", Value: 204}, {Name: "RDMA_DRIVER_MLX5", Value: 1}, {Name: "RDMA_MAX_PRIVATE_DATA", Value: 256}, @@ -52244,6 +52271,7 @@ var consts_ppc64le = []ConstValue{ {Name: "__NR_clock_nanosleep", Value: 248}, {Name: "__NR_clock_settime", Value: 245}, {Name: "__NR_clone", Value: 120}, + {Name: "__NR_clone3", Value: 435}, {Name: "__NR_close", Value: 6}, {Name: "__NR_connect", Value: 328}, {Name: "__NR_creat", Value: 8}, @@ -52392,6 +52420,7 @@ var consts_ppc64le = []ConstValue{ {Name: "__NR_pause", Value: 29}, {Name: "__NR_perf_event_open", Value: 319}, {Name: "__NR_personality", Value: 136}, + {Name: "__NR_pidfd_open", Value: 434}, {Name: "__NR_pidfd_send_signal", Value: 424}, {Name: "__NR_pipe", Value: 42}, {Name: "__NR_pipe2", Value: 317}, @@ -52535,4 +52564,4 @@ var consts_ppc64le = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_ppc64le = "16f82b19155f760162bb4f08946191a084797f74" +const revision_ppc64le = "49381a16fc88ae3d59f7b17b827c6eccf9284bc6" diff --git a/sys/linux/sys.txt b/sys/linux/sys.txt index 5fd07560..446b0dab 100644 --- a/sys/linux/sys.txt +++ b/sys/linux/sys.txt @@ -241,6 +241,19 @@ futimesat(dir fd_dir, pathname ptr[in, filename], times ptr[in, itimerval]) utimensat(dir fd_dir, pathname ptr[in, filename], times ptr[in, itimerval], flags flags[utimensat_flags]) clone(flags flags[clone_flags], sp buffer[in], parentid ptr[out, int32], childtid ptr[out, int32], tls buffer[in]) +clone3(args ptr[in, clone_args], size bytesize[args]) pid + +clone_args { + flags flags[clone_flags, int64] + pidfd ptr64[out, fd_pidfd] + child_tid ptr64[out, pid] + parent_tid ptr64[out, pid] + exit_signal signalno + exit_signal_pad const[0, int32] + stack ptr64[out, array[int8]] + stack_size bytesize[stack, int64] + tls ptr64[out, array[int8]] +} resource pid[int32]: 0, -1 resource uid[int32]: 0, -1, 0xee00, 0xee01 @@ -369,6 +382,7 @@ setitimer(which flags[getitimer_which], new ptr[in, itimerval], old ptr[out, iti exit(code intptr) exit_group(code intptr) waitid(which flags[waitid_which], pid pid, infop ptr[out, siginfo, opt], options flags[wait_options], ru ptr[out, rusage, opt]) +waitid$P_PIDFD(which const[P_PIDFD], pidfd fd_pidfd, infop ptr[out, siginfo, opt], options flags[wait_options], ru ptr[out, rusage, opt]) wait4(pid pid, status ptr[out, int32, opt], options flags[wait_options], ru ptr[out, rusage, opt]) times(buf ptr[out, tms]) # Can send signals to all processes (pid=-1). @@ -431,6 +445,7 @@ resource fd_pidfd[fd] openat$pidfd(fd const[AT_FDCWD], file ptr[in, string["/proc/self"]], flags flags[open_flags], mode const[0]) fd_pidfd pidfd_send_signal(fd fd_pidfd, sig signalno, info ptr[in, siginfo], flags const[0]) +pidfd_open(pid pid, flags const[0]) fd_pidfd # Uncomment on your own account. #syz_open_dev$char(dev const[0xc], major intptr, minor intptr) fd diff --git a/sys/linux/sys_amd64.const b/sys/linux/sys_amd64.const index 87d836bb..bfc45ed7 100644 --- a/sys/linux/sys_amd64.const +++ b/sys/linux/sys_amd64.const @@ -391,6 +391,7 @@ PTRACE_TRACEME = 0 P_ALL = 0 P_PGID = 2 P_PID = 1 +P_PIDFD = 3 READ_IMPLIES_EXEC = 4194304 RENAME_EXCHANGE = 2 RENAME_NOREPLACE = 1 @@ -554,6 +555,7 @@ __NR_clock_gettime = 228 __NR_clock_nanosleep = 230 __NR_clock_settime = 227 __NR_clone = 56 +__NR_clone3 = 435 __NR_close = 3 __NR_creat = 85 __NR_delete_module = 176 @@ -659,6 +661,7 @@ __NR_open_by_handle_at = 304 __NR_openat = 257 __NR_pause = 34 __NR_personality = 135 +__NR_pidfd_open = 434 __NR_pidfd_send_signal = 424 __NR_pipe = 22 __NR_pipe2 = 293 diff --git a/sys/linux/sys_arm64.const b/sys/linux/sys_arm64.const index 28f6585c..f08d5559 100644 --- a/sys/linux/sys_arm64.const +++ b/sys/linux/sys_arm64.const @@ -391,6 +391,7 @@ PTRACE_TRACEME = 0 P_ALL = 0 P_PGID = 2 P_PID = 1 +P_PIDFD = 3 READ_IMPLIES_EXEC = 4194304 RENAME_EXCHANGE = 2 RENAME_NOREPLACE = 1 @@ -554,6 +555,7 @@ __NR_clock_gettime = 113 __NR_clock_nanosleep = 115 __NR_clock_settime = 112 __NR_clone = 220 +__NR_clone3 = 435 __NR_close = 57 # __NR_creat is not set __NR_delete_module = 106 @@ -659,6 +661,7 @@ __NR_open_by_handle_at = 265 __NR_openat = 56 # __NR_pause is not set __NR_personality = 92 +__NR_pidfd_open = 434 __NR_pidfd_send_signal = 424 # __NR_pipe is not set __NR_pipe2 = 59 diff --git a/sys/linux/sys_ppc64le.const b/sys/linux/sys_ppc64le.const index 805c3394..71d0afb5 100644 --- a/sys/linux/sys_ppc64le.const +++ b/sys/linux/sys_ppc64le.const @@ -391,6 +391,7 @@ PTRACE_TRACEME = 0 P_ALL = 0 P_PGID = 2 P_PID = 1 +P_PIDFD = 3 READ_IMPLIES_EXEC = 4194304 RENAME_EXCHANGE = 2 RENAME_NOREPLACE = 1 @@ -554,6 +555,7 @@ __NR_clock_gettime = 246 __NR_clock_nanosleep = 248 __NR_clock_settime = 245 __NR_clone = 120 +__NR_clone3 = 435 __NR_close = 6 __NR_creat = 8 __NR_delete_module = 129 @@ -659,6 +661,7 @@ __NR_open_by_handle_at = 346 __NR_openat = 286 __NR_pause = 29 __NR_personality = 136 +__NR_pidfd_open = 434 __NR_pidfd_send_signal = 424 __NR_pipe = 42 __NR_pipe2 = 317