Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/libcrun/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,13 +1233,13 @@ setup_executable_path (struct container_entrypoint_s *entrypoint_args, runtime_s
{
if (entrypoint_args->custom_handler == NULL && crun_error_get_errno (err) == ENOENT)
return ret;
}

/* If it fails for any other reason, ignore the failure. We'll try again the lookup
once the process switched to the use that runs in the container. This might be necessary
when opening a file that is on a network file system like NFS, where CAP_DAC_OVERRIDE
is not honored. */
crun_error_release (err);
/* If it fails for any other reason, ignore the failure. We'll try again the lookup
once the process switched to the use that runs in the container. This might be necessary
when opening a file that is on a network file system like NFS, where CAP_DAC_OVERRIDE
is not honored. */
crun_error_release (err);
}
Comment on lines +1238 to +1242
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): The error object is never released anymore and the comment no longer matches the behavior.

With crun_error_release(err); moved inside the if and after return ret;, it becomes unreachable for the ENOENT path and is never called for other errors (since there is no release after the if). This changes behavior from "ignore failure but clean up" to leaking err. Please move crun_error_release(err); back outside the if or place it before the return so all paths release the error while keeping the ignore-and-retry behavior.

}

return 0;
Expand Down
Loading