Skip to content

Commit

Permalink
seccomp: add cachestat syscall (kernel v6.5, libseccomp v2.5.5)
Browse files Browse the repository at this point in the history
Add this syscall to match the profile in containerd

containerd: containerd/containerd@a6e52c7
libseccomp: seccomp/libseccomp@53267af
kernel: torvalds/linux@cf264e1

    NAME
        cachestat - query the page cache statistics of a file.

    SYNOPSIS
        #include <sys/mman.h>

        struct cachestat_range {
            __u64 off;
            __u64 len;
        };

        struct cachestat {
            __u64 nr_cache;
            __u64 nr_dirty;
            __u64 nr_writeback;
            __u64 nr_evicted;
            __u64 nr_recently_evicted;
        };

        int cachestat(unsigned int fd, struct cachestat_range *cstat_range,
            struct cachestat *cstat, unsigned int flags);

    DESCRIPTION
        cachestat() queries the number of cached pages, number of dirty
        pages, number of pages marked for writeback, number of evicted
        pages, number of recently evicted pages, in the bytes range given by
        `off` and `len`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4d0d5ee)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Feb 6, 2024
1 parent 61b82be commit 67e9aa6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions profiles/seccomp/default.json
Expand Up @@ -64,6 +64,7 @@
"alarm",
"bind",
"brk",
"cachestat",
"capget",
"capset",
"chdir",
Expand Down
1 change: 1 addition & 0 deletions profiles/seccomp/default_linux.go
Expand Up @@ -56,6 +56,7 @@ func DefaultProfile() *Seccomp {
"alarm",
"bind",
"brk",
"cachestat", // kernel v6.5, libseccomp v2.5.5
"capget",
"capset",
"chdir",
Expand Down

0 comments on commit 67e9aa6

Please sign in to comment.