plougher / squashfs-tools

tools to create and extract Squashfs filesystems
GNU General Public License v2.0
758 stars 193 forks source link

Mksquashfs crash when handling directories with certain extended attributes. #244

Closed Matviy closed 1 year ago

Matviy commented 1 year ago

I have a directory /var/lib/tpm2-tss/system/keystore on RH9, it has the following extended attributes:

[root@test system]# getfattr -dm - keystore/
# file: keystore/
security.selinux="system_u:object_r:var_lib_t:s0"
system.posix_acl_default=0sAgAAAAEABwD/////BAAHAP////8IAAcAOwAAABAABwD/////IAAFAP////8=

When attempting to mksquashfs that directory with the latest 4.6, mksquashfs crashes.

Parallel mksquashfs: Using 4 processors
Creating 4.0 filesystem on /dev/loop1, block size 131072.
Unrecognised xattr prefix ��+
free(): invalid pointer
Aborted

Seems like it does not like the binary data in the posix_acl_default extended attribute. Excluding that specific extended attribute using the new features in 4.6 solves the issue.

This issue is not present on mksquashfs pre 4.6.

Matviy commented 1 year ago

The latest 4.6.1 seems to fix this issue. Closing.