sys/linux: add new arguments to struct clone_args for clone3()

Linux v5.5 extends struct clone_args for clone3() by two additional
parameters:

@set_tid:      Pointer to an array of type *pid_t. The size
               of the array is defined using @set_tid_size.
               This array is used to select PIDs/TIDs for
               newly created processes. The first element in
               this defines the PID in the most nested PID
               namespace. Each additional element in the array
               defines the PID in the parent PID namespace of
               the original PID namespace. If the array has
               less entries than the number of currently
               nested PID namespaces only the PIDs in the
               corresponding namespaces are set.
@set_tid_size: This defines the size of the array referenced
               in @set_tid. This cannot be larger than the
               kernel's limit of nested PID namespaces.

Cc: Adrian Reber <areber@redhat.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2019-11-26 11:43:01 +01:00 committed by Dmitry Vyukov
parent f72ffd024d
commit bc992c0ee4
7 changed files with 27 additions and 15 deletions

View File

@ -70,7 +70,7 @@
#if GOARCH_386
#define GOARCH "386"
#define SYZ_REVISION "b1293dbe2ee6665ac7b881658eafc706d1c60bd6"
#define SYZ_REVISION "b8df8694a669e9d5d47f80861ca802fed57ed6c4"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
@ -80,7 +80,7 @@
#if GOARCH_amd64
#define GOARCH "amd64"
#define SYZ_REVISION "d39d2d5ebff24446c5c0967745361523f7bf74d5"
#define SYZ_REVISION "77be4d61dfdd899c8fd951eb88591e37a4af9c3b"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
@ -90,7 +90,7 @@
#if GOARCH_arm
#define GOARCH "arm"
#define SYZ_REVISION "3faab3bd75e32594236822b84e777a660b8f44f1"
#define SYZ_REVISION "30fe6f6f30052aa0cb4f2faf14684a9daf096cca"
#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 "9309bbd8f2c02c715084efa8cdff142679b4e179"
#define SYZ_REVISION "e1c4269d6bf4622bd4db07d95b43e9f98a17c27a"
#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 "fe19530420a5ffe4da19879e46a4ca674ee11f98"
#define SYZ_REVISION "8d0319e849ff9f777be9f81414561fe16870344d"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096

View File

@ -1985,7 +1985,7 @@ var structDescs_386 = []*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{
{Key: StructKey{Name: "clone_args"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "clone_args", TypeSize: 80}, 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}}},
@ -1995,6 +1995,8 @@ var structDescs_386 = []*KeyedStruct{
&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}}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "set_tid", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "set_tid_size", TypeSize: 8}}, Path: []string{"set_tid"}},
}}},
{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},
@ -55909,4 +55911,4 @@ var consts_386 = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}
const revision_386 = "b1293dbe2ee6665ac7b881658eafc706d1c60bd6"
const revision_386 = "b8df8694a669e9d5d47f80861ca802fed57ed6c4"

View File

@ -1990,7 +1990,7 @@ 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{
{Key: StructKey{Name: "clone_args"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "clone_args", TypeSize: 80}, 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}}},
@ -2000,6 +2000,8 @@ var structDescs_amd64 = []*KeyedStruct{
&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}}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "set_tid", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "set_tid_size", TypeSize: 8}}, Path: []string{"set_tid"}},
}}},
{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},
@ -56464,4 +56466,4 @@ var consts_amd64 = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}
const revision_amd64 = "d39d2d5ebff24446c5c0967745361523f7bf74d5"
const revision_amd64 = "77be4d61dfdd899c8fd951eb88591e37a4af9c3b"

View File

@ -1985,7 +1985,7 @@ var structDescs_arm = []*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{
{Key: StructKey{Name: "clone_args"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "clone_args", TypeSize: 80}, 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}}},
@ -1995,6 +1995,8 @@ var structDescs_arm = []*KeyedStruct{
&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}}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "set_tid", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "set_tid_size", TypeSize: 8}}, Path: []string{"set_tid"}},
}}},
{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},
@ -55486,4 +55488,4 @@ var consts_arm = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}
const revision_arm = "3faab3bd75e32594236822b84e777a660b8f44f1"
const revision_arm = "30fe6f6f30052aa0cb4f2faf14684a9daf096cca"

View File

@ -1990,7 +1990,7 @@ 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{
{Key: StructKey{Name: "clone_args"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "clone_args", TypeSize: 80}, 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}}},
@ -2000,6 +2000,8 @@ var structDescs_arm64 = []*KeyedStruct{
&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}}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "set_tid", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "set_tid_size", TypeSize: 8}}, Path: []string{"set_tid"}},
}}},
{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},
@ -55816,4 +55818,4 @@ var consts_arm64 = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}
const revision_arm64 = "9309bbd8f2c02c715084efa8cdff142679b4e179"
const revision_arm64 = "e1c4269d6bf4622bd4db07d95b43e9f98a17c27a"

View File

@ -1989,7 +1989,7 @@ 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{
{Key: StructKey{Name: "clone_args"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "clone_args", TypeSize: 80}, 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}}},
@ -1999,6 +1999,8 @@ var structDescs_ppc64le = []*KeyedStruct{
&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}}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr64", FldName: "set_tid", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", TypeSize: 4}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "set_tid_size", TypeSize: 8}}, Path: []string{"set_tid"}},
}}},
{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},
@ -55781,4 +55783,4 @@ var consts_ppc64le = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}
const revision_ppc64le = "fe19530420a5ffe4da19879e46a4ca674ee11f98"
const revision_ppc64le = "8d0319e849ff9f777be9f81414561fe16870344d"

View File

@ -251,6 +251,8 @@ clone_args {
stack ptr64[out, array[int8]]
stack_size bytesize[stack, int64]
tls ptr64[out, array[int8]]
set_tid ptr64[in, array[pid]]
set_tid_size len[set_tid, int64]
}
resource pid[int32]: 0, -1