diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-03-27 11:39:58 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-03-27 11:39:58 +0200 |
| commit | bf5e585c5e1b12fe80ee486fdd48eeb71a13fa21 (patch) | |
| tree | 95748ad5d0c86675e3fd4264b8e66c3ba0c4a9c5 | |
| parent | c7e0d50a76c1970d8f326a49ef24fc5d19ee93c1 (diff) | |
executor: rework cgroups support
Turns out creating a cgroup per test is too expensive.
Moreover, it leads to hanged tasks as cgroup destruction
is asynchronous and overloads kernel work queues.
Create only a single cgroup per proc, but restrict
descriptions to mess with that single group,
instead test processes create own nested cgroups for messing.
| -rw-r--r-- | executor/common_linux.h | 57 | ||||
| -rw-r--r-- | executor/syscalls_linux.h | 25 | ||||
| -rw-r--r-- | pkg/csource/linux_common.go | 55 | ||||
| -rw-r--r-- | sys/linux/386.go | 11 | ||||
| -rw-r--r-- | sys/linux/amd64.go | 11 | ||||
| -rw-r--r-- | sys/linux/arm.go | 11 | ||||
| -rw-r--r-- | sys/linux/arm64.go | 11 | ||||
| -rw-r--r-- | sys/linux/cgroup.txt | 7 | ||||
| -rw-r--r-- | sys/linux/ppc64le.go | 11 |
9 files changed, 106 insertions, 93 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index a80cb8dc5..0d8b145a6 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -1671,6 +1671,29 @@ static void loop() snprintf(cgroupdir_cpu, sizeof(cgroupdir_cpu), "/syzcgroup/cpu/syz%llu", procid); char cgroupdir_net[64]; snprintf(cgroupdir_net, sizeof(cgroupdir_net), "/syzcgroup/net/syz%llu", procid); + if (mkdir(cgroupdir, 0777)) { + debug("mkdir(%s) failed: %d\n", cgroupdir, errno); + } + if (mkdir(cgroupdir_cpu, 0777)) { + debug("mkdir(%s) failed: %d\n", cgroupdir_cpu, errno); + } + if (mkdir(cgroupdir_net, 0777)) { + debug("mkdir(%s) failed: %d\n", cgroupdir_net, errno); + } + int pid = getpid(); + char procs_file[128]; + snprintf(procs_file, sizeof(procs_file), "%s/cgroup.procs", cgroupdir); + if (!write_file(procs_file, "%d", pid)) { + debug("write(%s) failed: %d\n", procs_file, errno); + } + snprintf(procs_file, sizeof(procs_file), "%s/cgroup.procs", cgroupdir_cpu); + if (!write_file(procs_file, "%d", pid)) { + debug("write(%s) failed: %d\n", procs_file, errno); + } + snprintf(procs_file, sizeof(procs_file), "%s/cgroup.procs", cgroupdir_net); + if (!write_file(procs_file, "%d", pid)) { + debug("write(%s) failed: %d\n", procs_file, errno); + } #endif int iter; for (iter = 0;; iter++) { @@ -1681,17 +1704,6 @@ static void loop() if (mkdir(cwdbuf, 0777)) fail("failed to mkdir"); #endif -#if defined(SYZ_EXECUTOR) || defined(SYZ_ENABLE_CGROUPS) - if (mkdir(cgroupdir, 0777)) { - debug("mkdir(%s) failed: %d\n", cgroupdir, errno); - } - if (mkdir(cgroupdir_cpu, 0777)) { - debug("mkdir(%s) failed: %d\n", cgroupdir_cpu, errno); - } - if (mkdir(cgroupdir_net, 0777)) { - debug("mkdir(%s) failed: %d\n", cgroupdir_net, errno); - } -#endif #if defined(SYZ_EXECUTOR) // TODO: consider moving the read into the child. // Potentially it can speed up things a bit -- when the read finishes @@ -1722,16 +1734,6 @@ static void loop() if (symlink(cgroupdir_net, "./cgroup.net")) { debug("symlink(%s, ./cgroup.net) failed: %d\n", cgroupdir_net, errno); } - int pid = getpid(); - if (!write_file("./cgroup/cgroup.procs", "%d", pid)) { - debug("write(./cgroup/cgroup.procs) failed: %d\n", errno); - } - if (!write_file("./cgroup.cpu/cgroup.procs", "%d", pid)) { - debug("write(./cgroup.cpu/cgroup.procs) failed: %d\n", errno); - } - if (!write_file("./cgroup.net/cgroup.procs", "%d", pid)) { - debug("write(./cgroup.net/cgroup.procs) failed: %d\n", errno); - } #endif #if defined(SYZ_EXECUTOR) if (flag_enable_tun) { @@ -1777,7 +1779,7 @@ static void loop() // is that the test processes setups a userfaultfd for itself, // then the main thread hangs when it wants to page in a page. // Below we check if the test process still executes syscalls - // and kill it after 200ms of inactivity. + // and kill it after 500ms of inactivity. uint64 now = current_time_ms(); uint32 now_executed = __atomic_load_n(output_data, __ATOMIC_RELAXED); if (executed_calls != now_executed) { @@ -1809,17 +1811,6 @@ static void loop() #if defined(SYZ_EXECUTOR) || defined(SYZ_USE_TMP_DIR) remove_dir(cwdbuf); #endif -#if defined(SYZ_EXECUTOR) || defined(SYZ_ENABLE_CGROUPS) - if (rmdir(cgroupdir)) { - debug("rmdir(%s) failed: %d\n", cgroupdir, errno); - } - if (rmdir(cgroupdir_cpu)) { - debug("rmdir(%s) failed: %d\n", cgroupdir_cpu, errno); - } - if (rmdir(cgroupdir_net)) { - debug("rmdir(%s) failed: %d\n", cgroupdir_net, errno); - } -#endif #if defined(SYZ_EXECUTOR) || defined(SYZ_RESET_NET_NAMESPACE) reset_net_namespace(); #endif diff --git a/executor/syscalls_linux.h b/executor/syscalls_linux.h index 9a4e40b97..c23c1d642 100644 --- a/executor/syscalls_linux.h +++ b/executor/syscalls_linux.h @@ -2,11 +2,11 @@ #if defined(__i386__) || 0 #define GOARCH "386" -#define SYZ_REVISION "a824837d8ff4977deb75479a7e24923dea93d43c" +#define SYZ_REVISION "08cbb09acf4d3d8e82933c83a64bf3131ab25385" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 1663; +unsigned syscall_count = 1664; call_t syscalls[] = { {"accept4", 364}, {"accept4$alg", 364}, @@ -999,6 +999,7 @@ call_t syscalls[] = { {"mkdir", 39}, {"mkdirat", 296}, {"mkdirat$cgroup", 296}, + {"mkdirat$cgroup_root", 296}, {"mknod", 14}, {"mknod$loop", 14}, {"mknodat", 297}, @@ -1677,11 +1678,11 @@ call_t syscalls[] = { #if defined(__x86_64__) || 0 #define GOARCH "amd64" -#define SYZ_REVISION "19ac00543e4b0f4b0bf07613621b657183a41b86" +#define SYZ_REVISION "3a0e3a3bc8fc12f4a6ae3ac9a8b06310f37ec343" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 1715; +unsigned syscall_count = 1716; call_t syscalls[] = { {"accept", 43}, {"accept$alg", 43}, @@ -2688,6 +2689,7 @@ call_t syscalls[] = { {"mkdir", 83}, {"mkdirat", 258}, {"mkdirat$cgroup", 258}, + {"mkdirat$cgroup_root", 258}, {"mknod", 133}, {"mknod$loop", 133}, {"mknodat", 259}, @@ -3404,11 +3406,11 @@ call_t syscalls[] = { #if defined(__arm__) || 0 #define GOARCH "arm" -#define SYZ_REVISION "0a97c03cf5907e48f42a9a826f88b4e39e4afaa6" +#define SYZ_REVISION "42e4743c2ba28b83149861a991d92d8a57bde754" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 1660; +unsigned syscall_count = 1661; call_t syscalls[] = { {"accept", 285}, {"accept$alg", 285}, @@ -4372,6 +4374,7 @@ call_t syscalls[] = { {"mkdir", 39}, {"mkdirat", 323}, {"mkdirat$cgroup", 323}, + {"mkdirat$cgroup_root", 323}, {"mknod", 14}, {"mknod$loop", 14}, {"mknodat", 324}, @@ -5076,11 +5079,11 @@ call_t syscalls[] = { #if defined(__aarch64__) || 0 #define GOARCH "arm64" -#define SYZ_REVISION "e82a067ef79081eb69e442b15ef1800dd9e3ad1e" +#define SYZ_REVISION "545a1e402b47c522c937cea7a0a4470f5e94c693" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 1644; +unsigned syscall_count = 1645; call_t syscalls[] = { {"accept", 202}, {"accept$alg", 202}, @@ -6044,6 +6047,7 @@ call_t syscalls[] = { {"mincore", 232}, {"mkdirat", 34}, {"mkdirat$cgroup", 34}, + {"mkdirat$cgroup_root", 34}, {"mknodat", 33}, {"mlock", 228}, {"mlock2", 284}, @@ -6732,11 +6736,11 @@ call_t syscalls[] = { #if defined(__ppc64__) || defined(__PPC64__) || defined(__powerpc64__) || 0 #define GOARCH "ppc64le" -#define SYZ_REVISION "e069291bc34cc73da59b5e7bd74039f531bfcdb5" +#define SYZ_REVISION "95a8c6cda415f9d253a03a8418c48f51e5213205" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 1634; +unsigned syscall_count = 1635; call_t syscalls[] = { {"accept", 330}, {"accept$alg", 330}, @@ -7703,6 +7707,7 @@ call_t syscalls[] = { {"mkdir", 39}, {"mkdirat", 287}, {"mkdirat$cgroup", 287}, + {"mkdirat$cgroup_root", 287}, {"mknod", 14}, {"mknod$loop", 14}, {"mknodat", 288}, diff --git a/pkg/csource/linux_common.go b/pkg/csource/linux_common.go index 0c9d6571e..250b366d4 100644 --- a/pkg/csource/linux_common.go +++ b/pkg/csource/linux_common.go @@ -2698,6 +2698,29 @@ static void loop() snprintf(cgroupdir_cpu, sizeof(cgroupdir_cpu), "/syzcgroup/cpu/syz%llu", procid); char cgroupdir_net[64]; snprintf(cgroupdir_net, sizeof(cgroupdir_net), "/syzcgroup/net/syz%llu", procid); + if (mkdir(cgroupdir, 0777)) { + debug("mkdir(%s) failed: %d\n", cgroupdir, errno); + } + if (mkdir(cgroupdir_cpu, 0777)) { + debug("mkdir(%s) failed: %d\n", cgroupdir_cpu, errno); + } + if (mkdir(cgroupdir_net, 0777)) { + debug("mkdir(%s) failed: %d\n", cgroupdir_net, errno); + } + int pid = getpid(); + char procs_file[128]; + snprintf(procs_file, sizeof(procs_file), "%s/cgroup.procs", cgroupdir); + if (!write_file(procs_file, "%d", pid)) { + debug("write(%s) failed: %d\n", procs_file, errno); + } + snprintf(procs_file, sizeof(procs_file), "%s/cgroup.procs", cgroupdir_cpu); + if (!write_file(procs_file, "%d", pid)) { + debug("write(%s) failed: %d\n", procs_file, errno); + } + snprintf(procs_file, sizeof(procs_file), "%s/cgroup.procs", cgroupdir_net); + if (!write_file(procs_file, "%d", pid)) { + debug("write(%s) failed: %d\n", procs_file, errno); + } #endif int iter; for (iter = 0;; iter++) { @@ -2707,17 +2730,6 @@ static void loop() if (mkdir(cwdbuf, 0777)) fail("failed to mkdir"); #endif -#if defined(SYZ_EXECUTOR) || defined(SYZ_ENABLE_CGROUPS) - if (mkdir(cgroupdir, 0777)) { - debug("mkdir(%s) failed: %d\n", cgroupdir, errno); - } - if (mkdir(cgroupdir_cpu, 0777)) { - debug("mkdir(%s) failed: %d\n", cgroupdir_cpu, errno); - } - if (mkdir(cgroupdir_net, 0777)) { - debug("mkdir(%s) failed: %d\n", cgroupdir_net, errno); - } -#endif #if defined(SYZ_EXECUTOR) receive_execute(false); #endif @@ -2745,16 +2757,6 @@ static void loop() if (symlink(cgroupdir_net, "./cgroup.net")) { debug("symlink(%s, ./cgroup.net) failed: %d\n", cgroupdir_net, errno); } - int pid = getpid(); - if (!write_file("./cgroup/cgroup.procs", "%d", pid)) { - debug("write(./cgroup/cgroup.procs) failed: %d\n", errno); - } - if (!write_file("./cgroup.cpu/cgroup.procs", "%d", pid)) { - debug("write(./cgroup.cpu/cgroup.procs) failed: %d\n", errno); - } - if (!write_file("./cgroup.net/cgroup.procs", "%d", pid)) { - debug("write(./cgroup.net/cgroup.procs) failed: %d\n", errno); - } #endif #if defined(SYZ_EXECUTOR) if (flag_enable_tun) { @@ -2815,17 +2817,6 @@ static void loop() #if defined(SYZ_EXECUTOR) || defined(SYZ_USE_TMP_DIR) remove_dir(cwdbuf); #endif -#if defined(SYZ_EXECUTOR) || defined(SYZ_ENABLE_CGROUPS) - if (rmdir(cgroupdir)) { - debug("rmdir(%s) failed: %d\n", cgroupdir, errno); - } - if (rmdir(cgroupdir_cpu)) { - debug("rmdir(%s) failed: %d\n", cgroupdir_cpu, errno); - } - if (rmdir(cgroupdir_net)) { - debug("rmdir(%s) failed: %d\n", cgroupdir_net, errno); - } -#endif #if defined(SYZ_EXECUTOR) || defined(SYZ_RESET_NET_NAMESPACE) reset_net_namespace(); #endif diff --git a/sys/linux/386.go b/sys/linux/386.go index 182ba4074..65a73abb5 100644 --- a/sys/linux/386.go +++ b/sys/linux/386.go @@ -18538,7 +18538,12 @@ var syscalls_386 = []*Syscall{ {NR: 296, Name: "mkdirat$cgroup", CallName: "mkdirat", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "fd", TypeSize: 4}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 5}, Kind: 2, SubKind: "cgroup_names", Values: []string{"syz0\x00", "syz1\x00"}}}, - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 4}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 4}}, Val: 511}, + }}, + {NR: 296, Name: "mkdirat$cgroup_root", CallName: "mkdirat", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 4}}, Val: 18446744073709551516}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 4}}, Val: 511}, }}, {NR: 14, Name: "mknod", CallName: "mknod", Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}}, @@ -18759,7 +18764,7 @@ var syscalls_386 = []*Syscall{ }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 295, Name: "openat$cgroup_root", CallName: "openat", Args: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 4}}, Val: 18446744073709551516}, - &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup\x00", "./cgroup.cpu\x00", "./cgroup.net\x00"}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 4}}, Val: 2097154}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 4}}}, }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, @@ -26843,4 +26848,4 @@ var consts_386 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_386 = "a824837d8ff4977deb75479a7e24923dea93d43c" +const revision_386 = "08cbb09acf4d3d8e82933c83a64bf3131ab25385" diff --git a/sys/linux/amd64.go b/sys/linux/amd64.go index b0de98e09..1259cb233 100644 --- a/sys/linux/amd64.go +++ b/sys/linux/amd64.go @@ -18970,7 +18970,12 @@ var syscalls_amd64 = []*Syscall{ {NR: 258, Name: "mkdirat$cgroup", CallName: "mkdirat", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "fd", TypeSize: 4}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 5}, Kind: 2, SubKind: "cgroup_names", Values: []string{"syz0\x00", "syz1\x00"}}}, - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 8}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}, Val: 511}, + }}, + {NR: 258, Name: "mkdirat$cgroup_root", CallName: "mkdirat", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}, Val: 511}, }}, {NR: 133, Name: "mknod", CallName: "mknod", Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}}, @@ -19241,7 +19246,7 @@ var syscalls_amd64 = []*Syscall{ }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 257, Name: "openat$cgroup_root", CallName: "openat", Args: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516}, - &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup\x00", "./cgroup.cpu\x00", "./cgroup.net\x00"}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}, Val: 2097154}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}}, }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, @@ -27499,4 +27504,4 @@ var consts_amd64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_amd64 = "19ac00543e4b0f4b0bf07613621b657183a41b86" +const revision_amd64 = "3a0e3a3bc8fc12f4a6ae3ac9a8b06310f37ec343" diff --git a/sys/linux/arm.go b/sys/linux/arm.go index 084d9db0f..273eff0e5 100644 --- a/sys/linux/arm.go +++ b/sys/linux/arm.go @@ -18218,7 +18218,12 @@ var syscalls_arm = []*Syscall{ {NR: 323, Name: "mkdirat$cgroup", CallName: "mkdirat", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "fd", TypeSize: 4}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 5}, Kind: 2, SubKind: "cgroup_names", Values: []string{"syz0\x00", "syz1\x00"}}}, - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 4}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 4}}, Val: 511}, + }}, + {NR: 323, Name: "mkdirat$cgroup_root", CallName: "mkdirat", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 4}}, Val: 18446744073709551516}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 4}}, Val: 511}, }}, {NR: 14, Name: "mknod", CallName: "mknod", Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}}, @@ -18469,7 +18474,7 @@ var syscalls_arm = []*Syscall{ }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 322, Name: "openat$cgroup_root", CallName: "openat", Args: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 4}}, Val: 18446744073709551516}, - &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup\x00", "./cgroup.cpu\x00", "./cgroup.net\x00"}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 4}}, Val: 2097154}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 4}}}, }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, @@ -26562,4 +26567,4 @@ var consts_arm = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_arm = "0a97c03cf5907e48f42a9a826f88b4e39e4afaa6" +const revision_arm = "42e4743c2ba28b83149861a991d92d8a57bde754" diff --git a/sys/linux/arm64.go b/sys/linux/arm64.go index bbffbfe1e..834899f33 100644 --- a/sys/linux/arm64.go +++ b/sys/linux/arm64.go @@ -18553,7 +18553,12 @@ var syscalls_arm64 = []*Syscall{ {NR: 34, Name: "mkdirat$cgroup", CallName: "mkdirat", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "fd", TypeSize: 4}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 5}, Kind: 2, SubKind: "cgroup_names", Values: []string{"syz0\x00", "syz1\x00"}}}, - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 8}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}, Val: 511}, + }}, + {NR: 34, Name: "mkdirat$cgroup_root", CallName: "mkdirat", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}, Val: 511}, }}, {NR: 33, Name: "mknodat", CallName: "mknodat", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_dir", FldName: "dirfd", TypeSize: 4}}, @@ -18784,7 +18789,7 @@ var syscalls_arm64 = []*Syscall{ }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 56, Name: "openat$cgroup_root", CallName: "openat", Args: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516}, - &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup\x00", "./cgroup.cpu\x00", "./cgroup.net\x00"}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}, Val: 2097154}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}}, }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, @@ -26881,4 +26886,4 @@ var consts_arm64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_arm64 = "e82a067ef79081eb69e442b15ef1800dd9e3ad1e" +const revision_arm64 = "545a1e402b47c522c937cea7a0a4470f5e94c693" diff --git a/sys/linux/cgroup.txt b/sys/linux/cgroup.txt index 1037bb823..951be2123 100644 --- a/sys/linux/cgroup.txt +++ b/sys/linux/cgroup.txt @@ -9,9 +9,10 @@ resource fd_cgroup_subtree[fd] resource fd_cgroup_int[fd] resource fd_cgroup_pid[fd] +mkdirat$cgroup_root(fd const[AT_FDCWD], path ptr[in, string[cgroup_dirs]], mode const[0x1ff]) +mkdirat$cgroup(fd fd_cgroup, path ptr[in, string[cgroup_names]], mode const[0x1ff]) openat$cgroup_root(fd const[AT_FDCWD], file ptr[in, string[cgroup_dirs]], flags const[CGROUP_OPEN_FLAGS], mode const[0]) fd_cgroup openat$cgroup(fd fd_cgroup, file ptr[in, string[cgroup_names]], flags const[CGROUP_OPEN_FLAGS], mode const[0]) fd_cgroup -mkdirat$cgroup(fd fd_cgroup, path ptr[in, string[cgroup_names]], mode flags[open_mode]) openat$cgroup_ro(fd fd_cgroup, file ptr[in, string[cgroup_ctrl_read]], flags const[O_RDONLY], mode const[0]) fd openat$cgroup_int(fd fd_cgroup, file ptr[in, string[cgroup_ctrl_int]], flags const[O_RDWR], mode const[0]) fd_cgroup_int openat$cgroup_procs(fd fd_cgroup, file ptr[in, string[cgroup_proc_files]], flags const[O_RDWR], mode const[0]) fd_cgroup_pid @@ -41,9 +42,9 @@ cgroup_control { sp const[32, int8] } [packed] -cgroup_dirs = "./cgroup", "./cgroup.cpu", "./cgroup.net" +cgroup_dirs = "./cgroup/syz0", "./cgroup/syz1", "./cgroup.cpu/syz0", "./cgroup.cpu/syz1", "./cgroup.net/syz0", "./cgroup.net/syz1" cgroup_names = "syz0", "syz1" -cgroup_paths = "./cgroup", "./cgroup.cpu", "./cgroup.net", "./cgroup/syz0", "./cgroup.cpu/syz0", "./cgroup.net/syz0", "./cgroup/syz1", "./cgroup.cpu/syz1", "./cgroup.net/syz1" +cgroup_paths = "./cgroup/syz0", "./cgroup.cpu/syz0", "./cgroup.net/syz0", "./cgroup/syz1", "./cgroup.cpu/syz1", "./cgroup.net/syz1" # '+', '-' cgroup_control_signs = 43, 45 # '+', '-', ',', '/', ';' and digits diff --git a/sys/linux/ppc64le.go b/sys/linux/ppc64le.go index 8ce722bfd..02dba8405 100644 --- a/sys/linux/ppc64le.go +++ b/sys/linux/ppc64le.go @@ -18417,7 +18417,12 @@ var syscalls_ppc64le = []*Syscall{ {NR: 287, Name: "mkdirat$cgroup", CallName: "mkdirat", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "fd", TypeSize: 4}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 5}, Kind: 2, SubKind: "cgroup_names", Values: []string{"syz0\x00", "syz1\x00"}}}, - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 8}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}, Val: 511}, + }}, + {NR: 287, Name: "mkdirat$cgroup_root", CallName: "mkdirat", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}, Val: 511}, }}, {NR: 14, Name: "mknod", CallName: "mknod", Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}}, @@ -18638,7 +18643,7 @@ var syscalls_ppc64le = []*Syscall{ }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 286, Name: "openat$cgroup_root", CallName: "openat", Args: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516}, - &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup\x00", "./cgroup.cpu\x00", "./cgroup.net\x00"}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}, Val: 2097154}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}}, }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, @@ -26643,4 +26648,4 @@ var consts_ppc64le = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_ppc64le = "e069291bc34cc73da59b5e7bd74039f531bfcdb5" +const revision_ppc64le = "95a8c6cda415f9d253a03a8418c48f51e5213205" |
