File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,18 @@ fn has_clone3() -> bool {
15
15
let err = (res == -1)
16
16
.then(|| Error::last_os_error())
17
17
.expect("probe syscall should not succeed");
18
- err.raw_os_error() != Some(libc::ENOSYS)
18
+
19
+ // If the `clone3` syscall is not implemented in the current kernel version it should return an
20
+ // `ENOSYS` error. Docker also blocks the whole syscall inside unprivileged containers, and
21
+ // returns `EPERM` (instead of `ENOSYS`) when a program tries to invoke the syscall. Because of
22
+ // that we need to check for *both* `ENOSYS` and `EPERM`.
23
+ //
24
+ // Note that Docker's behavior is breaking other projects (notably glibc), so they're planning
25
+ // to update their filtering to return `ENOSYS` in a future release:
26
+ //
27
+ // https://github.com/moby/moby/issues/42680
28
+ //
29
+ err.raw_os_error() != Some(libc::ENOSYS) && err.raw_os_error() != Some(libc::EPERM)
19
30
}
20
31
21
32
fn main() {
You can’t perform that action at this time.
0 commit comments