-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrectly handled clock_gettime64 syscall #8326
Comments
Thanks for the report, @igorsnunes. I found a seemingly relevant patch in version 19.03.9 of the upstream engine: moby/moby@v19.03.8...v19.03.9. But we have engine 19.03.12 in Desktop 2.3.0.4 so maybe there's something else we need to do in our VM. We'll take a look. |
Hi @igorsnunes -- we believe we need to upgrade the version of We're also considering switching Docker Desktop to using a dynamically-linked In summary
Thanks again for your report. I was hoping there was a quick fix available but unfortunately I've failed to find one. /lifecycle frozen |
See docker/for-win#8326 Signed-off-by: David Scott <dave.scott@docker.com>
* Docker Desktop release notes: add clock_gettime64 known issue See docker/for-win#8326 Signed-off-by: David Scott <dave.scott@docker.com> * Minor style update * minor style update * Minor style updte * Minor style update Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com>
Hello, just for information i found this issue while searching reasons why |
Thanks @djs55 and @stephen-turner . I'll keep following your updates. |
I am running into the same issue on MacOS with (currently latest) Docker for Desktop 3.2.2: the ...and this can be workarounded with Anyway, showing this on the log below (container run with default flags +
With
|
Expected behavior
Actual behavior
Information
Hi everyone,
While running my application on a i386 debian image (bullseye), I am constantly receiving an "Operation not permitted" for the clock_gettime system call. This error only happens when using a newer version of libc6 (2.31-1). And when this event happens, at some point, my application stops working.
Doing some investigation I figured out that newer versions of glibc, clock_gettime() syscalls falls back to clock_gettime64(). When using "strace" (to scan system calls) on my application, I can see that when clock_gettime64() is called, an EPERM is returned. This specific error code breaks the application. The ploblem with this is: glibc expects a ENOSYS, indicating that this syscall is not implemented by the kernel. If that happens, libc uses another implementation of clock_gettime, returning the correct value; if EPERM is returned instead, libc handles this return value as an error.
I can bypass this issue by running the container with the “—privileged” flag, or creating a seccomp profile that has the following configuration:
"defaultAction": "SCMP_ACT_TRACE"
Which means: return ENOSYS as a default behavior, instead of EPERM.
The –privileged flag bypasses seccomp, and allow every syscall to be handled by the kernel (and apparently, the kernel returns the correct code).
Question: why “clock_gettime64” is not being matched on any seccomp profile (including the default one, used by the engine)? The only way I managed to make this syscall returns ENOSYS, using seccomp profile, was enabling the defaultAction as SCMP_ACT_TRACE. And as far as I can see, this is not a good practice; the correct action would be SCMP_ACT_ERRNO for default cases. See below the two approaches that I tried on my seccomp profile, and didn`t work:
Explicitly allowing clock_gettime64:
{
"names": ["clock_gettime64"],
"action": "SCMP_ACT_ALLOW",
"args": [],
"comment": "",
"includes": {},
"excludes": {}
}
Explicitly setting the behavior of clock_gettime64 to TRACE:
{
"names": ["clock_gettime64"],
"action": "SCMP_ACT_TRACE",
"args": [],
"comment": "",
"includes": {},
"excludes": {}
}
As shown here https://bugs.launchpad.net/ubuntu/+source/libseccomp/+bug/1868720 , this might be a problem related to older versions of libseccomp installed on the host. Is there a way to get this information from the host linux system used by Docker Desktop?
Please, let me know if I am missing something on my analysis.
Ps: Some documentation used for this analysis:
https://gitlab.alpinelinux.org/alpine/aports/-/issues/11774
https://lwn.net/Articles/795128/
https://docs.docker.com/engine/security/seccomp/
https://bugs.launchpad.net/ubuntu/+source/libseccomp/+bug/1868720
Steps to reproduce the behavior
Compile the following code for 32 bits, i.e. "gcc -m32":
Run the binary on a docker image with a newer version of libc on a i386 environment. You can do:
The text was updated successfully, but these errors were encountered: