namespace: Clone root dir descriptor before use
Before doing anything with the root directory file descriptor, let's make sure we clone it first so that the caller can't mess with mount fd attributes via mount_setattr() anymore. We clone during parsing instead of in executor so that the caller can't mess with the mount fd between invocations.
This commit is contained in:
@@ -2877,6 +2877,7 @@ void exec_params_shallow_clear(ExecParameters *p) {
|
||||
p->fd_names = strv_free(p->fd_names);
|
||||
p->files_env = strv_free(p->files_env);
|
||||
p->fds = mfree(p->fds);
|
||||
p->root_directory_fd = safe_close(p->root_directory_fd);
|
||||
p->exec_fd = safe_close(p->exec_fd);
|
||||
p->user_lookup_fd = -EBADF;
|
||||
p->bpf_restrict_fs_map_fd = -EBADF;
|
||||
|
||||
Reference in New Issue
Block a user