Skip to content

pkg/oci: update TestOpenUserFileCapsReads to use newlined data - #13674

Merged
mxpv merged 1 commit into
containerd:mainfrom
thaJeztah:update_TestOpenUserFileCapsReads
Jun 26, 2026
Merged

mxpv merged 1 commit into
containerd:mainfrom
thaJeztah:update_TestOpenUserFileCapsReads

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

This test verifies the maximum file-size constraints that were added in containerd7b05ec4. However, github.com/moby/[email protected] adds similar constraints, including a constraint on line-length (1M): moby/sys@2c56c3d that may hit before the file-size limit is reached if the data does not contain newlines.

This patch updates the test to use data that includes newlines to make sure it's testing the file-size constraints, not line-limit constraints.

This test verifies the maximum file-size constraints that were added in
[containerd7b05ec4]. However, github.com/moby/[email protected] adds similar
constraints, including a constraint on line-length (1M): [moby/sys@2c56c3d]
that may hit before the file-size limit is reached if the data does not
contain newlines.

This patch updates the test to use data that includes newlines to make
sure it's testing the file-size constraints, not line-limit constraints.

[containerd7b05ec4]: containerd@7b05ec4
[moby/sys@2c56c3d]: moby/sys@2c56c3d

Signed-off-by: Sebastiaan van Stijn <[email protected]>

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.

Pull request overview

This PR updates the pkg/oci user-bounds test data to include newline-separated padding so the test continues to validate containerd’s openUserFile total-read cap (maxUserFileBytes) rather than tripping newer line-length protections in moby/sys/user parsing.

Changes:

  • Replace NUL-byte padding in TestOpenUserFileCapsReads with repeated comment lines (# padding\n) to ensure frequent newlines.
  • Ensure the generated padding ends with a newline to avoid creating a long trailing line.
  • Add an explicit regression-test note referencing CVE-2026-47262 / GHSA-jpcc-p29g-p8mq.

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

@thaJeztah
thaJeztah requested a review from vvoland June 26, 2026 08:19
@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Jun 26, 2026
@mxpv
mxpv added this pull request to the merge queue Jun 26, 2026
Merged via the queue into containerd:main with commit dd0f94a Jun 26, 2026
50 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jun 26, 2026
@thaJeztah
thaJeztah deleted the update_TestOpenUserFileCapsReads branch June 26, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants