mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
Merge pull request #3342 from kolyshkin/cloned-binary
libct/nsenter: fix extra runc re-exec on tmpfs
This commit is contained in:
@@ -18,6 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
* When Intel RDT feature is not available, its initialization is skipped,
|
||||
resulting in slightly faster `runc exec` and `runc run`. (#3306)
|
||||
|
||||
### Fixed
|
||||
|
||||
* In case the runc binary resides on tmpfs, `runc init` no longer re-execs
|
||||
itself twice. (#3342)
|
||||
|
||||
## [1.1.0] - 2022-01-14
|
||||
|
||||
> A plan depends as much upon execution as it does upon concept.
|
||||
|
||||
@@ -137,7 +137,7 @@ static void *must_realloc(void *ptr, size_t size)
|
||||
*/
|
||||
static int is_self_cloned(void)
|
||||
{
|
||||
int fd, ret, is_cloned = 0;
|
||||
int fd, is_cloned = 0;
|
||||
struct stat statbuf = { };
|
||||
struct statfs fsbuf = { };
|
||||
|
||||
@@ -153,11 +153,9 @@ static int is_self_cloned(void)
|
||||
* sharing it isn't a bad thing -- and an admin could bind-mount a sealed
|
||||
* memfd to /usr/bin/runc to allow re-use).
|
||||
*/
|
||||
ret = fcntl(fd, F_GET_SEALS);
|
||||
if (ret >= 0) {
|
||||
is_cloned = (ret == RUNC_MEMFD_SEALS);
|
||||
is_cloned = (fcntl(fd, F_GET_SEALS) == RUNC_MEMFD_SEALS);
|
||||
if (is_cloned)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* All other forms require CLONED_BINARY_ENV, since they are potentially
|
||||
|
||||
Reference in New Issue
Block a user