Skip to content

overlayWhiteoutConverter.ConvertRead: reject invalid AUFS hardlink metadata - #54

Draft
thaJeztah wants to merge 1 commit into
moby:mainfrom
thaJeztah:whiteout_skip_plnk
Draft

overlayWhiteoutConverter.ConvertRead: reject invalid AUFS hardlink metadata#54
thaJeztah wants to merge 1 commit into
moby:mainfrom
thaJeztah:whiteout_skip_plnk

Conversation

@thaJeztah

@thaJeztah thaJeztah commented Jul 20, 2026

Copy link
Copy Markdown
Member

Handle WhiteoutLinkDir explicitly when converting whiteouts during
unpack.

The .wh..wh.plnk entry is AUFS-internal hardlink metadata and does not
represent removal of a file. Without an explicit case, it falls through
to the generic whiteout handling and is incorrectly converted into a
whiteout for .wh.plnk.

Treat the metadata entry as an invalid archive and return an error
instead of incorrectly creating an overlay whiteout for it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the overlayfs whiteout conversion logic during Untar to handle the AUFS hardlink metadata directory (.wh..wh.plnk) explicitly, so it doesn’t get misinterpreted as a normal AUFS whiteout and converted into an overlay whiteout for .wh.plnk.

Changes:

  • Adds an explicit case in overlayWhiteoutConverter.ConvertRead for AUFS hardlink metadata (.wh..wh.plnk).
  • Introduces a new test covering .wh..wh.plnk entries during overlay whiteout conversion.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
archive_linux.go Adds explicit handling for AUFS hardlink metadata entries during overlay whiteout conversion.
archive_linux_test.go Adds a test intended to validate .wh..wh.plnk behavior during Untar with overlay whiteouts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread archive_linux.go Outdated
Comment on lines +80 to +85
name := path.Clean(hdr.Name)
if name == WhiteoutLinkDir || strings.HasPrefix(name, WhiteoutLinkDir+"/") {
// AUFS-internal hardlink metadata is not part of the extracted filesystem.
return false, fmt.Errorf("invalid whiteout entry %q", hdr.Name)
}
base := filepath.Base(name)
Comment thread archive_linux_test.go Outdated
@thaJeztah
thaJeztah force-pushed the whiteout_skip_plnk branch from a22c257 to 363bf88 Compare July 20, 2026 15:23
@codecov-commenter

codecov-commenter commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.55%. Comparing base (2cd730e) to head (351baeb).
⚠️ Report is 60 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #54      +/-   ##
==========================================
- Coverage   66.35%   65.55%   -0.80%     
==========================================
  Files          42       42              
  Lines        2027     2041      +14     
==========================================
- Hits         1345     1338       -7     
- Misses        497      531      +34     
+ Partials      185      172      -13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thaJeztah
thaJeztah force-pushed the whiteout_skip_plnk branch 2 times, most recently from d9e568e to ce62124 Compare July 20, 2026 17:27
@thaJeztah thaJeztah changed the title overlayWhiteoutConverter.ConvertRead: ignore AUFS hardlink metadata whiteout overlayWhiteoutConverter.ConvertRead: reject invalid AUFS hardlink metadata Jul 21, 2026
…tadata

Handle WhiteoutLinkDir explicitly when converting whiteouts during
unpack.

The .wh..wh.plnk entry is AUFS-internal hardlink metadata and does not
represent removal of a file. Without an explicit case, it falls through
to the generic whiteout handling and is incorrectly converted into a
whiteout for .wh.plnk.

Treat the metadata entry as an invalid archive and return an error
instead of incorrectly creating an overlay whiteout for it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@thaJeztah
thaJeztah marked this pull request as ready for review July 21, 2026 10:34
@thaJeztah
thaJeztah marked this pull request as draft July 22, 2026 08:35
@thaJeztah

Copy link
Copy Markdown
Member Author

Need to look what's best here; skip these files, error, or actually use them for hard-links? (UnpackLayer seems to have some logic for that through a temporary directory).

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.

3 participants