Skip to content

Verify payload length early on#310

Merged
alexlarsson merged 1 commit intocomposefs:mainfrom
cgwalters:symlink-limit
Aug 5, 2024
Merged

Verify payload length early on#310
alexlarsson merged 1 commit intocomposefs:mainfrom
cgwalters:symlink-limit

Conversation

@cgwalters
Copy link
Copy Markdown
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 composefs:main Aug 5, 2024
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