Visitar URL original
mount: copy options before replacing lowerdir by samuelkarp · Pull Request #14551 · containerd/containerd · GitHub
Skip to content

mount: copy options before replacing lowerdir - #14551

Open
samuelkarp wants to merge 1 commit into
containerd:mainfrom
samuelkarp:fix/mount-idmapped-options-alias
Open

samuelkarp wants to merge 1 commit into
containerd:mainfrom
samuelkarp:fix/mount-idmapped-options-alias

Conversation

@samuelkarp

Copy link
Copy Markdown
Member

Mounting an overlay with ID mapping replaces its lowerdir option with temporary ID-mapped directories. The replacement was made in place, so it also changed the Mount the caller passed in. After the call, that Mount's lowerdir option listed temporary directories that were already unmounted.

Assisted-by: Claude Code:claude-opus-5-5

Mounting an overlay with ID mapping replaces its lowerdir option with
temporary ID-mapped directories. The replacement was made in place, so
it also changed the Mount the caller passed in. After the call, that
Mount's lowerdir option listed temporary directories that were already
unmounted.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Samuel Karp <me@samuelkarp.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 07:02
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Nov 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the change intended to preserve caller-owned mount options during ID-mapped overlay mounting.

No open issues 🎉

What changed in this PR

Prevents ID-mapped overlay mounting from modifying the caller’s mount options and leaving them pointing to temporary directories that have already been unmounted.

Changes:

  • Clones the options slice before replacing and appending the lowerdir option.
  • Adds a regression test verifying the replacement options and preservation of the original input.
File Description
core/​mount/​mount_linux.go Extracts lowerdir replacement into a helper that copies options before modifying them.
core/​mount/​mount_linux_test.go Tests lowerdir replacement and verifies that caller-owned options remain unchanged.

Review effort: Balanced

This branch has not been deployed

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

Labels

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants