sys/linux: add new pidfd_getfd syscall

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2020-02-06 02:57:52 +01:00 committed by Andrey Konovalov
parent 662cf49ae3
commit 5be3a391ba
15 changed files with 61 additions and 12 deletions

12
executor/defs.h generated
View File

@ -70,7 +70,7 @@
#if GOARCH_386
#define GOARCH "386"
#define SYZ_REVISION "84c3c78eff5c3d2bec65378261b09dc0eb5dd264"
#define SYZ_REVISION "488b52dcf741754c2509508756e62a8ba3f81f2b"
#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 "7f945156b7074aa478b8d6e3e8bdd835434bd2d1"
#define SYZ_REVISION "704942e7a1ea3eabb144b9435a76d907aeccdb48"
#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 "e9390fd58634699bc6a68f0f67f821bf7b0ab383"
#define SYZ_REVISION "40f992d03beb380276f0bf307364f1cf0f206c6c"
#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 "5b9531fe5418e9fec2eb6c37fdc896446e61936c"
#define SYZ_REVISION "75387c759f9c7815467567ed67117ab8b269e9db"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
@ -110,7 +110,7 @@
#if GOARCH_mips64le
#define GOARCH "mips64le"
#define SYZ_REVISION "4f29bb8b1cd8e7ff8c19ebce1809e1dba86face2"
#define SYZ_REVISION "5f7a5ad86058695b856977f967f602387e58d2fb"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
@ -120,7 +120,7 @@
#if GOARCH_ppc64le
#define GOARCH "ppc64le"
#define SYZ_REVISION "ba0df3df2adef37bd095e45a87d010791519994c"
#define SYZ_REVISION "41c17cb8867c35f3c9e5f1fb7f30036b4ea65b96"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096

6
executor/syscalls.h generated
View File

@ -4098,6 +4098,7 @@ const call_t syscalls[] = {
{"perf_event_open", 336},
{"perf_event_open$cgroup", 336},
{"personality", 136},
{"pidfd_getfd", 438},
{"pidfd_open", 434},
{"pidfd_send_signal", 424},
{"pipe", 42},
@ -7397,6 +7398,7 @@ const call_t syscalls[] = {
{"perf_event_open", 298},
{"perf_event_open$cgroup", 298},
{"personality", 135},
{"pidfd_getfd", 438},
{"pidfd_open", 434},
{"pidfd_send_signal", 424},
{"pipe", 22},
@ -10649,6 +10651,7 @@ const call_t syscalls[] = {
{"perf_event_open", 364},
{"perf_event_open$cgroup", 364},
{"personality", 136},
{"pidfd_getfd", 438},
{"pidfd_open", 434},
{"pidfd_send_signal", 424},
{"pipe", 42},
@ -13886,6 +13889,7 @@ const call_t syscalls[] = {
{"perf_event_open", 241},
{"perf_event_open$cgroup", 241},
{"personality", 92},
{"pidfd_getfd", 438},
{"pidfd_open", 434},
{"pidfd_send_signal", 424},
{"pipe2", 59},
@ -17019,6 +17023,7 @@ const call_t syscalls[] = {
{"perf_event_open", 5292},
{"perf_event_open$cgroup", 5292},
{"personality", 5132},
{"pidfd_getfd", 5438},
{"pidfd_open", 5434},
{"pidfd_send_signal", 5424},
{"pipe", 5021},
@ -20272,6 +20277,7 @@ const call_t syscalls[] = {
{"perf_event_open", 319},
{"perf_event_open$cgroup", 319},
{"personality", 136},
{"pidfd_getfd", 438},
{"pidfd_open", 434},
{"pidfd_send_signal", 424},
{"pipe", 42},

8
sys/linux/gen/386.go generated
View File

@ -58911,6 +58911,11 @@ var syscalls_386 = []*Syscall{
{NR: 136, Name: "personality", CallName: "personality", Args: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "personality_flags", FldName: "persona", TypeSize: 4}}, Vals: []uint64{0, 6, 8, 12, 15, 16, 262144, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 67108869, 67108873, 67108874, 67108875, 67108877, 68157441, 68157454, 83886082, 83886084, 83886087, 100663299, 134217728}},
}},
{NR: 438, Name: "pidfd_getfd", CallName: "pidfd_getfd", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "pidfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 4}}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{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: 4}}},
@ -75606,6 +75611,7 @@ var consts_386 = []ConstValue{
{"__NR_pause", 29},
{"__NR_perf_event_open", 336},
{"__NR_personality", 136},
{"__NR_pidfd_getfd", 438},
{"__NR_pidfd_open", 434},
{"__NR_pidfd_send_signal", 424},
{"__NR_pipe", 42},
@ -75755,4 +75761,4 @@ var consts_386 = []ConstValue{
{"ethtool_per_queue_op_size", 128},
}
const revision_386 = "84c3c78eff5c3d2bec65378261b09dc0eb5dd264"
const revision_386 = "488b52dcf741754c2509508756e62a8ba3f81f2b"

View File

@ -59856,6 +59856,11 @@ 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, 6, 8, 12, 15, 16, 262144, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 67108869, 67108873, 67108874, 67108875, 67108877, 68157441, 68157454, 83886082, 83886084, 83886087, 100663299, 134217728}},
}},
{NR: 438, Name: "pidfd_getfd", CallName: "pidfd_getfd", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "pidfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{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}}},
@ -76566,6 +76571,7 @@ var consts_amd64 = []ConstValue{
{"__NR_pause", 34},
{"__NR_perf_event_open", 298},
{"__NR_personality", 135},
{"__NR_pidfd_getfd", 438},
{"__NR_pidfd_open", 434},
{"__NR_pidfd_send_signal", 424},
{"__NR_pipe", 22},
@ -76715,4 +76721,4 @@ var consts_amd64 = []ConstValue{
{"ethtool_per_queue_op_size", 128},
}
const revision_amd64 = "7f945156b7074aa478b8d6e3e8bdd835434bd2d1"
const revision_amd64 = "704942e7a1ea3eabb144b9435a76d907aeccdb48"

8
sys/linux/gen/arm.go generated
View File

@ -58649,6 +58649,11 @@ var syscalls_arm = []*Syscall{
{NR: 136, Name: "personality", CallName: "personality", Args: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "personality_flags", FldName: "persona", TypeSize: 4}}, Vals: []uint64{0, 6, 8, 12, 15, 16, 262144, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 67108869, 67108873, 67108874, 67108875, 67108877, 68157441, 68157454, 83886082, 83886084, 83886087, 100663299, 134217728}},
}},
{NR: 438, Name: "pidfd_getfd", CallName: "pidfd_getfd", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "pidfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 4}}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{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: 4}}},
@ -75261,6 +75266,7 @@ var consts_arm = []ConstValue{
{"__NR_pause", 29},
{"__NR_perf_event_open", 364},
{"__NR_personality", 136},
{"__NR_pidfd_getfd", 438},
{"__NR_pidfd_open", 434},
{"__NR_pidfd_send_signal", 424},
{"__NR_pipe", 42},
@ -75407,4 +75413,4 @@ var consts_arm = []ConstValue{
{"ethtool_per_queue_op_size", 128},
}
const revision_arm = "e9390fd58634699bc6a68f0f67f821bf7b0ab383"
const revision_arm = "40f992d03beb380276f0bf307364f1cf0f206c6c"

View File

@ -59379,6 +59379,11 @@ 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, 6, 8, 12, 15, 16, 262144, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 67108869, 67108873, 67108874, 67108875, 67108877, 68157441, 68157454, 83886082, 83886084, 83886087, 100663299, 134217728}},
}},
{NR: 438, Name: "pidfd_getfd", CallName: "pidfd_getfd", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "pidfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{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}}},
@ -75928,6 +75933,7 @@ var consts_arm64 = []ConstValue{
{"__NR_openat", 56},
{"__NR_perf_event_open", 241},
{"__NR_personality", 92},
{"__NR_pidfd_getfd", 438},
{"__NR_pidfd_open", 434},
{"__NR_pidfd_send_signal", 424},
{"__NR_pipe2", 59},
@ -76060,4 +76066,4 @@ var consts_arm64 = []ConstValue{
{"ethtool_per_queue_op_size", 128},
}
const revision_arm64 = "5b9531fe5418e9fec2eb6c37fdc896446e61936c"
const revision_arm64 = "75387c759f9c7815467567ed67117ab8b269e9db"

View File

@ -58008,6 +58008,11 @@ var syscalls_mips64le = []*Syscall{
{NR: 5132, Name: "personality", CallName: "personality", Args: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "personality_flags", FldName: "persona", TypeSize: 8}}, Vals: []uint64{0, 6, 8, 12, 15, 16, 262144, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 67108869, 67108873, 67108874, 67108875, 67108877, 68157441, 68157454, 83886082, 83886084, 83886087, 100663299, 134217728}},
}},
{NR: 5438, Name: "pidfd_getfd", CallName: "pidfd_getfd", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "pidfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{NR: 5434, 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}}},
@ -73575,6 +73580,7 @@ var consts_mips64le = []ConstValue{
{"__NR_pause", 5033},
{"__NR_perf_event_open", 5292},
{"__NR_personality", 5132},
{"__NR_pidfd_getfd", 5438},
{"__NR_pidfd_open", 5434},
{"__NR_pidfd_send_signal", 5424},
{"__NR_pipe", 5021},
@ -73721,4 +73727,4 @@ var consts_mips64le = []ConstValue{
{"ethtool_per_queue_op_size", 128},
}
const revision_mips64le = "4f29bb8b1cd8e7ff8c19ebce1809e1dba86face2"
const revision_mips64le = "5f7a5ad86058695b856977f967f602387e58d2fb"

View File

@ -59339,6 +59339,11 @@ 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, 6, 8, 12, 15, 16, 262144, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 67108869, 67108873, 67108874, 67108875, 67108877, 68157441, 68157454, 83886082, 83886084, 83886087, 100663299, 134217728}},
}},
{NR: 438, Name: "pidfd_getfd", CallName: "pidfd_getfd", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_pidfd", FldName: "pidfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{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}}},
@ -75911,6 +75916,7 @@ var consts_ppc64le = []ConstValue{
{"__NR_pause", 29},
{"__NR_perf_event_open", 319},
{"__NR_personality", 136},
{"__NR_pidfd_getfd", 438},
{"__NR_pidfd_open", 434},
{"__NR_pidfd_send_signal", 424},
{"__NR_pipe", 42},
@ -76057,4 +76063,4 @@ var consts_ppc64le = []ConstValue{
{"ethtool_per_queue_op_size", 128},
}
const revision_ppc64le = "ba0df3df2adef37bd095e45a87d010791519994c"
const revision_ppc64le = "41c17cb8867c35f3c9e5f1fb7f30036b4ea65b96"

View File

@ -478,6 +478,7 @@ openat$pidfd(fd const[AT_FDCWD], file ptr[in, string["/proc/self"]], flags flags
openat$thread_pidfd(fd const[AT_FDCWD], file ptr[in, string["/proc/thread-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
pidfd_getfd(pidfd fd_pidfd, fd fd, flags const[0]) fd
# Uncomment on your own account.
#syz_open_dev$char(dev const[0xc], major intptr, minor intptr) fd

View File

@ -675,6 +675,7 @@ __NR_open_by_handle_at = 342
__NR_openat = 295
__NR_pause = 29
__NR_personality = 136
__NR_pidfd_getfd = 438
__NR_pidfd_open = 434
__NR_pidfd_send_signal = 424
__NR_pipe = 42

View File

@ -675,6 +675,7 @@ __NR_open_by_handle_at = 304
__NR_openat = 257
__NR_pause = 34
__NR_personality = 135
__NR_pidfd_getfd = 438
__NR_pidfd_open = 434
__NR_pidfd_send_signal = 424
__NR_pipe = 22

View File

@ -675,6 +675,7 @@ __NR_open_by_handle_at = 371
__NR_openat = 322
__NR_pause = 29
__NR_personality = 136
__NR_pidfd_getfd = 438
__NR_pidfd_open = 434
__NR_pidfd_send_signal = 424
__NR_pipe = 42

View File

@ -675,6 +675,7 @@ __NR_open_by_handle_at = 265
__NR_openat = 56
# __NR_pause is not set
__NR_personality = 92
__NR_pidfd_getfd = 438
__NR_pidfd_open = 434
__NR_pidfd_send_signal = 424
# __NR_pipe is not set

View File

@ -675,6 +675,7 @@ __NR_open_by_handle_at = 5299
__NR_openat = 5247
__NR_pause = 5033
__NR_personality = 5132
__NR_pidfd_getfd = 5438
__NR_pidfd_open = 5434
__NR_pidfd_send_signal = 5424
__NR_pipe = 5021

View File

@ -675,6 +675,7 @@ __NR_open_by_handle_at = 346
__NR_openat = 286
__NR_pause = 29
__NR_personality = 136
__NR_pidfd_getfd = 438
__NR_pidfd_open = 434
__NR_pidfd_send_signal = 424
__NR_pipe = 42