From: Sandeep Dhavale Date: Tue, 20 Aug 2024 21:01:23 +0000 (-0700) Subject: erofs-utils: lib: actually skip the unidentified xattrs X-Git-Tag: v1.8.2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb8a0f34727a4c0524792fecf9d02c5135f6e8c3;p=platform%2Fupstream%2Ferofs-utils.git erofs-utils: lib: actually skip the unidentified xattrs parse_one_xattr() will return null if it detects unidentified xattr. In such cases we need to skip this xattr which was our intention than try to add it in erofs_xattr_add() which results in null pointer dereference. Fixes: 3037f8958f3b ("erofs-utils: skip all unidentified xattrs from local paths") Signed-off-by: Sandeep Dhavale Link: https://lore.kernel.org/r/20240820210123.2684886-2-dhavale@google.com Signed-off-by: Gao Xiang --- diff --git a/lib/xattr.c b/lib/xattr.c index 651657f..9f31f2d 100644 --- a/lib/xattr.c +++ b/lib/xattr.c @@ -448,6 +448,9 @@ static int read_xattrs_from_file(const char *path, mode_t mode, ret = PTR_ERR(item); goto err; } + /* skip unidentified xattrs */ + if (!item) + continue; ret = erofs_xattr_add(ixattrs, item); if (ret < 0)