please add -all-root and -no-xattrs to mksquashfs options
Metadata
Current evaluation
Fixed by merged snapcraft PR #334 (e93fcc0a8), adding mksquashfs -all-root and -no-xattrs for safer, reproducible SquashFS output.
Resolution: closed resolved
Reason: Snapcraft PR #334 was merged as e93fcc0a8, with implementation commit 7df2fe5a2, and added both requested mksquashfs options.
Evaluated by: mr-cal-bot
No scores available.
Issue body
One of the things we want to do with store checks is to make sure that the squashfs is not crafted in a way that might allow exploiting kernel vulnerabilities. It was decided some time ago that how we would handle this is that the store would take the original snap create a checksum, unsquash it then create another snap from the unsquashed directory, then create a checksum of that. If the original checksum and the resquashed snap's checksum match, then everything is ok.
In order for the checksums to match though, we need to be sure that the resquashing doesn't introduce unintended changes that would affect the checksum. Today's squashfs-tools has been updated to allow extracting the timestamp from the original squashfs so that it may be used when requashing the snap. What remains is adjusting snapcraft to call mksquashfs with options that will help ensure the squashfs can be resquashed and verified. In order to do this, please adjust snapcraft to call mksquashfs with '-all-root' and '-no-xattrs' (the latter isn't strictly needed, but is a safety net to guard against people trying to circumvent the system).
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged snapcraft PR #334 (e93fcc0a8), adding mksquashfs -all-root and -no-xattrs for safer, reproducible SquashFS output. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged canonical/snapcraft#334 (e93fcc0a8), adding mksquashfs -all-root and -no-xattrs for safer, reproducible squashfs creation. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged canonical/snapcraft#334 (e93fcc0a8) to pass mksquashfs -all-root and -no-xattrs, improving squashfs security and reproducibility. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #334 (merge commit e93fcc0a8) added -all-root and -no-xattrs to mksquashfs, ensuring resquashed snaps retain matching checksums. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as implemented. Added -all-root and -no-xattrs to mksquashfs calls to ensure consistent checksums during snap resquashing for security verification. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The request to add -all-root and -no-xattrs to mksquashfs for snapcraft checksum verification was abandoned. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed. Added -all-root and -no-xattrs flags to snapcraft's mksquashfs calls to ensure consistent checksums during store verification and prevent circumvention. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without action. The request to add -all-root and -no-xattrs to mksquashfs options for snapcraft verification was abandoned after over ten years. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
canonical/snapcraft#334
(confidence 100%)
Merged PR adding -all-root and -no-xattrs to Snapcraft's SquashFS build command.
-
Related To:
snapcraft (launchpad)#1557513
(confidence 98%)
Follow-up for preserving non-root ownership in OS/base snaps, resolved by canonical/snapcraft#391.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #334 More attributes for the squashfs'ed snap | snapcraft | merged | Merged PR #334 via e93fcc0a8, adding mksquashfs -all-root and -no-xattrs to improve snap security and reproducibility. | |
| #1557513 please add option to override -all-root in "snapcraft snap" | snapcraft (launchpad) | closed | Resolved by canonical/snapcraft#391 (commit 8887fe616, 'Snaps of type os should not squash with -all-root'): snaps of type 'os' now omit mksquashfs -all-root, preserving system-user ownership for livecd rootfs builds. | |
| #1576763 snaps have different checksums on repeated mksquashfs runs | snapcraft (launchpad) | closed | Fixed by using mksquashfs -no-fragments in snapcraft PR #1805 (commit 9a131cb5b); snapd PR #4396 applied the option to review tools. | |
| #1805 lifecycle: use the -no-fragments mksquashfs option | snapcraft | merged | Merged in #1805 (commit 9a131cb5b), adding mksquashfs -no-fragments so snap composition is predictable and review tools can validate snaps. |