Skip to content

Conversation

@tao12345666333
Copy link
Contributor

follow up to #41344 (comment)

Note: openat2() first appeared in Linux 5.6. And Glibc does not provide a wrapper for this system call; call it using
syscall(2).

ref: https://man7.org/linux/man-pages/man2/openat2.2.html

@thaJeztah
Copy link
Member

Oh, you need to edit or re-generate the JSON variant of the profile as well;


[2020-08-14T07:09:16.081Z] The result of go generate ./profiles/seccomp/ differs
[2020-08-14T07:09:16.081Z] 
[2020-08-14T07:09:16.081Z]  M profiles/seccomp/default.json
[2020-08-14T07:09:16.081Z] 
[2020-08-14T07:09:16.081Z] Please re-run go generate ./profiles/seccomp/

After this is merged, could you also open a pull request in containerd to update the profile to match? https://github.com/containerd/containerd/tree/master/contrib/seccomp

@thaJeztah
Copy link
Member

@tao12345666333
Copy link
Contributor Author

Thanks, let me take a look.

@tao12345666333 tao12345666333 force-pushed the add-openat2-to-seccomp-profile branch from 1c9bad2 to b8988c8 Compare August 16, 2020 08:00
@tao12345666333
Copy link
Contributor Author

I wonder if libseccomp needs an update for this; I see only a single occurence of openat2 https://github.com/seccomp/libseccomp/search?q=openat2&unscoped_q=openat2

@thaJeztah it seems like libseccomp has been updated (release/2.4) seccomp/libseccomp@b3206ad

@tao12345666333
Copy link
Contributor Author

After this is merged, could you also open a pull request in containerd to update the profile to match?

Opened PR containerd/containerd#4481

@thaJeztah
Copy link
Member

it seems like libseccomp has been updated (release/2.4) seccomp/libseccomp@b3206ad

Ah; yes, I see they switched to a different approach for "master" and the 2.5 branch, and now use a csv; seccomp/libseccomp@f5b3166

Master (and 2.5 branch) already had the openat2 syscall (in the above commit) and later updated to kernel 5.8.x in seccomp/libseccomp@5696c89#diff-afab4e57b1c976404582fcde2763f6b6L236

@thaJeztah
Copy link
Member

Looking at that last link; should we add faccessat2 as well? I see that was newly added, and l see faccessat is in our current profile?

@tao12345666333
Copy link
Contributor Author

Yes, I missed it.
Thanks. Let me add it.

@thaJeztah thaJeztah changed the title Add openat2 to default seccomp profile. Add openat2 and faccessat2 to default seccomp profile. Aug 17, 2020
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
Copy link
Member

Hmmm

All nodes of label ‘ppc64le-ubuntu-1604’ are offline

@thaJeztah
Copy link
Member

Ignoring the ppc64le stage, which is unrelated

@thaJeztah thaJeztah merged commit 868578e into moby:master Aug 17, 2020
@thaJeztah thaJeztah added this to the 20.03.0 milestone Aug 17, 2020
@tao12345666333 tao12345666333 deleted the add-openat2-to-seccomp-profile branch August 17, 2020 15:35
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Mar 1, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Mar 1, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Mar 1, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Mar 1, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Mar 1, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Mar 1, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Mar 1, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Mar 1, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
jhuntwork added a commit to jhuntwork/moby that referenced this pull request Mar 10, 2021
Fixes moby#41704

The latest released versions of the static binaries (20.10.3) are still unable
to use faccessat2 with musl-1.2.2 even though this was addressed in moby#41353 and
related issues. The underlying cause seems to be that the build system
here still uses the default version of libseccomp shipped with buster.
An updated version is available in buster backports:
https://packages.debian.org/buster-backports/libseccomp-dev

Signed-off-by: Jeremy Huntwork <[email protected]>
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Mar 15, 2021
Fixes moby#41704

The latest released versions of the static binaries (20.10.3) are still unable
to use faccessat2 with musl-1.2.2 even though this was addressed in moby#41353 and
related issues. The underlying cause seems to be that the build system
here still uses the default version of libseccomp shipped with buster.
An updated version is available in buster backports:
https://packages.debian.org/buster-backports/libseccomp-dev

Signed-off-by: Jeremy Huntwork <[email protected]>
(cherry picked from commit 1600e85)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Apr 3, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Apr 3, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Apr 7, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Apr 10, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Apr 18, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Apr 19, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Apr 19, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Apr 19, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
atomlong pushed a commit to atomlong/run-on-arch-action that referenced this pull request Apr 19, 2021
Since glibc 2.33, the faccessat() function tries the faccessat2 system
call first and falls back to the faccessat system call on older
kernels [1].  However, the seccomp profile provided by old Docker engines
does not allow faccessat2 (fixed by [2][3]). As a result, the faccessat2
system call returns EPERM, and glibc returns an error in this case. Using
a patched glibc to workaround this issue.

Note that the aforementioned glibc commit does not mean that glibc 2.33
building on new kernels does not work with old kernels. Instead, the
__LINUX_KERNEL_VERSION macro is 0 by default to achieve best-effort
compatibility with various kernel versions.

[1] https://sourceware.org/git/?p=glibc.git;a=patch;h=3d3ab573a5f3071992cbc4f57d50d1d29d55bde2
[2] moby/moby#41353
[3] moby/moby#41381
nosamad pushed a commit to WAGO/docker-engine that referenced this pull request Sep 13, 2021
Fixes moby#41704

The latest released versions of the static binaries (20.10.3) are still unable
to use faccessat2 with musl-1.2.2 even though this was addressed in moby#41353 and
related issues. The underlying cause seems to be that the build system
here still uses the default version of libseccomp shipped with buster.
An updated version is available in buster backports:
https://packages.debian.org/buster-backports/libseccomp-dev

Signed-off-by: Jeremy Huntwork <[email protected]>
(cherry picked from commit 1600e85)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
nosamad pushed a commit to WAGO/docker-engine that referenced this pull request Sep 15, 2021
Fixes moby#41704

The latest released versions of the static binaries (20.10.3) are still unable
to use faccessat2 with musl-1.2.2 even though this was addressed in moby#41353 and
related issues. The underlying cause seems to be that the build system
here still uses the default version of libseccomp shipped with buster.
An updated version is available in buster backports:
https://packages.debian.org/buster-backports/libseccomp-dev

Signed-off-by: Jeremy Huntwork <[email protected]>
(cherry picked from commit 1600e85)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants