Package: squashfs-tools
Version: 1:4.4-1
Severity: normal
Tags: patch
User: tails-...@boum.org
Usertags: reproducible-builds

Hi,

as reported on https://github.com/plougher/squashfs-tools/issues/78,
mksquashfs sometimes produces non-reproducible SquashFS when xattrs
are used in the input directory. This causes trouble for Tails.

Unfortunately I did not manage to create a minimal reproducer for the
problem, but the attached patch fixes the problem for me in my
real-world scenario. This patch has been submitted upstream 2 years
ago¹; I'm trying to encourage upstream to review it but I don't know
how long it will take, so it would be sweet if we could have this
trivial fix in Debian earlier :)

[1] https://github.com/plougher/squashfs-tools/pull/39

Cheers,
-- 
intrigeri

commit ad4b8f0aad4c659c1e437ed94897230cbdb9800d
Author: Henrik Grindal Bakken <henri...@cisco.com>
Origin: https://github.com/plougher/squashfs-tools/pull/39/commits/ad4b8f0aad4c659c1e437ed94897230cbdb9800d
Date:   Wed Dec 6 13:18:51 2017 +0100

    xattr: Initialize header to avoid valgrind warning
    
    The 'unused' field was written uninitialized to disk.  This introduces
    a randomness into the file system, and it also ends up as a valgrind
    warning.

--- a/squashfs-tools/xattr.c
+++ b/squashfs-tools/xattr.c
@@ -425,7 +425,7 @@
 	int i, avail_bytes;
 	char *datap = data_cache;
 	long long start_bytes = bytes;
-	struct squashfs_xattr_table header;
+	struct squashfs_xattr_table header = {};
 
 	if(xattr_ids == 0)
 		return SQUASHFS_INVALID_BLK;

Reply via email to