Skip to content

linux: do not skip EACCES in do_masked_or_readonly_path#2145

Open
Rajkaran-122 wants to merge 1 commit into
containers:mainfrom
Rajkaran-122:fix-eacces-skip-2139
Open

linux: do not skip EACCES in do_masked_or_readonly_path#2145
Rajkaran-122 wants to merge 1 commit into
containers:mainfrom
Rajkaran-122:fix-eacces-skip-2139

Conversation

@Rajkaran-122

Copy link
Copy Markdown

Description:
When attempting to open a masked or read-only path, crun was silently ignoring both ENOENT and EACCES errors.

To maintain consistency with runc's fail-closed behavior, this commit updates the logic so that only ENOENT is silently ignored. If EACCES is encountered, the error is now properly propagated, preventing potential protection bypasses if a masked/readonly paths entry cannot be opened due to permissions.

Fixes: #2139

Only skip ENOENT when opening masked/readonly path targets,
matching runc's fail-closed behavior. Previously EACCES was
also silently ignored, which could leave a configured
maskedPaths/readonlyPaths entry unprotected.

Fixes: containers#2139

Signed-off-by: Rajkaran <rajkaran122@example.com>
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@packit-as-a-service

Copy link
Copy Markdown

Ephemeral COPR build failed. @containers/packit-build please check.

@giuseppe

Copy link
Copy Markdown
Member

I am not sure yet whether we need this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

do_masked_or_readonly_path skips masked/readonly paths on EACCES — intentional? (fail-closed consistency with runc)

2 participants