erofs-utils: lib: fix user-after-free in xattr.c
PATCH 1/1 erofs-utils: lib: fix user-after-free in xattr.c
Currently, put_xattritem() does not remove the item from the hash table after freeing it, which may lead to a user-after-free issue.
This patch fixes it.
Fixes 47d6895a5ff9 ("erofs-utils: introduce inline xattr support")
Signed-off-by Hongzhen Luo <[email protected]>
--- lib/xattr.c | 1 + 1 file changed, 1 insertion(+)
lib/xattr.c +1 -0
@@ -169,6 +169,7 @@ static unsigned int put_xattritem(struct xattr_item *item) {if (item->count >1 )return --item->count; +hash_del (&item->node);free (item);return 0 ; }
Signature · 1 line
2.43.5
Looks good to me.
Reviewed-by Sandeep Dhavale <[email protected]>