Comment 2 for bug 1785499

Revision history for this message
Stéphane Graber (stgraber) wrote :

== fix 2GB limit in mksquashfs ==
=== Rationale ===
I don't have a direct use for this patch, but it seemed simpler and easier to just sync the entire stack of bugfixes with what we have in bionic and cosmic, so including this one too.

This fixes the case where a user attempts to append to a squashfs larger that's larger than 2GB.

=== Test case ===
Generate a large squashfs, easiest to achieve it is to turn off most compression options and feed it a large random file. Size should exceed 2GB.

Run mksquashfs with some random extra data to append and the pre-generated big squashfs.

Prior to this fix, you should get a failure like "Lseek on destination failed: Invalid argument".

With the fix applied, mksquashfs should just append the data and the resulting squashfs should be mountable and contain the new data.

=== Regression potential ===
This is another very small patch that looks "obviously correct" in that squashfs was simply overflowing an int in this case. The fix switches the type to "off_t" avoiding this issue.

The same fix has been in Ubuntu and Debian for a while so has seen a good amount of exposure.