containers / composefs

a file system for mounting container images
GNU General Public License v2.0
421 stars 29 forks source link

Verify payload length early on #310

Closed cgwalters closed 1 month ago

cgwalters commented 1 month ago

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: