Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify payload length early on #310

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

cgwalters
Copy link
Contributor

I was looking at something else here and happened
to notce we didn't seem to be sanity
checking the length of strings in some places.

Looking harder, first thing I checked is a
really long filename in a dump file; that's
fine, we do check that.

Next I tried symlinks, and that caused a
an assertion trip process abort (thankfully at least) deep in the bowels of the EROFS generation.

Fix this by checking the payload length against PATH_MAX.

Also:

  • Add the missing error checking in mkcomposefs
  • Add test infrastructure for "should fail" dumpfiles

@cgwalters cgwalters force-pushed the symlink-limit branch 2 times, most recently from 5e73d35 to 58081f6 Compare August 2, 2024 23:59
I was looking at something else here and happened
to notce we didn't seem to be sanity
checking the length of strings in some places.

Looking harder, first thing I checked is a
really long filename in a dump file; that's
fine, we do check that.

Next I tried symlinks, and that caused a
an assertion trip process abort (thankfully at least)
deep in the bowels of the EROFS generation.

Fix this by checking the payload length against PATH_MAX.

Also:

- Add the missing error checking in mkcomposefs
- Add test infrastructure for "should fail" dumpfiles

Signed-off-by: Colin Walters <walters@verbum.org>
@alexlarsson alexlarsson merged commit 9bdc377 into containers:main Aug 5, 2024
24 checks passed
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.

2 participants