diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-11-14 14:32:00 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-11-14 17:05:16 +0000 |
| commit | 6cc1688b7dcbbfc29192326ed3a7a9d421d9d067 (patch) | |
| tree | 6dc62b43bc05d2e5b94f9d063df4c6f3691eb232 | |
| parent | 77f3eeb755d0c3e79023775a7e72e05dded0f8a1 (diff) | |
sys/linux: ensure that auto descriptions are self-sufficient
Test that if we enable only auto descriptions, nothing gets disabled.
Currently nothing can create fd_cgroup which is used by the descriptions.
| -rw-r--r-- | prog/resources_test.go | 18 | ||||
| -rw-r--r-- | sys/linux/cgroup.txt | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/prog/resources_test.go b/prog/resources_test.go index 334f9bbe5..3804ef494 100644 --- a/prog/resources_test.go +++ b/prog/resources_test.go @@ -103,6 +103,24 @@ func TestTransitivelyEnabledCallsLinux(t *testing.T) { } } +func TestTransitivelyEnabledAutoCalls(t *testing.T) { + t.Parallel() + target, err := GetTarget("linux", "amd64") + if err != nil { + t.Fatal(err) + } + calls := make(map[*Syscall]bool) + for _, c := range target.Syscalls { + if c.Attrs.Automatic || c.Attrs.AutomaticHelper { + calls[c] = true + } + } + _, disabled := target.TransitivelyEnabledCalls(calls) + for c, reason := range disabled { + t.Errorf("disabled call %v: %v", c.Name, reason) + } +} + func TestGetInputResources(t *testing.T) { expectedRequiredResources := map[string]bool{ "required_res1": false, diff --git a/sys/linux/cgroup.txt b/sys/linux/cgroup.txt index 3067ef583..e9782df2d 100644 --- a/sys/linux/cgroup.txt +++ b/sys/linux/cgroup.txt @@ -15,7 +15,7 @@ resource fd_cgroup_pressure[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_root(fd const[AT_FDCWD], file ptr[in, string[cgroup_dirs]], flags const[CGROUP_OPEN_FLAGS], mode const[0]) fd_cgroup (automatic_helper) openat$cgroup(fd fd_cgroup, file ptr[in, string[cgroup_names]], flags const[CGROUP_OPEN_FLAGS], mode const[0]) fd_cgroup 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 |
