[PATCH 0/1] Improve handling of unidentified xattrs

Sandeep Dhavale dhavale at google.com
Wed Aug 21 07:01:22 AEST 2024


Hi,
I had a report that when erofs is built from the btrfs filesystem with
compression enabled, it would fail to build seemingly with error
"failed to build shared xattrs". We tried to fix this by returning 0 
(null) instead of error in parse_one_xattr(). However we need to
actually skip it else we get a null pointer dereference in 
erofs_xattr_add() trying to process the same.

Thanks,
Sandeep.

Tested with btrfs with compression enabled.
$ lsattr mtpt/
--------c------------- mtpt/sample.txt

Before:
mkfs.erofs -z lz4hc,9 erofs.img mtpt/
mkfs.erofs 1.8.1-dirty
<W> erofs: parse_one_xattr() Line[285] skipped unidentified xattr: btrfs.compression
Segmentation fault

After:
mkfs.erofs -z lz4hc,9 erofs.img mtpt/
mkfs.erofs 1.8.1-dirty
<W> erofs: parse_one_xattr() Line[285] skipped unidentified xattr: btrfs.compression
Processing sample.txt ...
<W> erofs: parse_one_xattr() Line[285] skipped unidentified xattr: btrfs.compression
Build completed.
------
Filesystem UUID: 9a1bb5a3-077a-40bc-972f-ed141059e7c8
Filesystem total blocks: 5 (of 4096-byte blocks)
Filesystem total inodes: 2
Filesystem total metadata blocks: 1
Filesystem total deduplicated bytes (of source files): 0 

Sandeep Dhavale (1):
  erofs-utils: lib: actually skip the unidentified xattrs

 lib/xattr.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.46.0.184.g6999bdac58-goog



More information about the Linux-erofs mailing list