erofs-utils: lib: fix user-after-free in xattr.c
authorHongzhen Luo <hongzhen@linux.alibaba.com>
Mon, 2 Dec 2024 02:40:19 +0000 (10:40 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Tue, 3 Dec 2024 02:18:07 +0000 (10:18 +0800)
commita4a24fda82386304ef65af8cb071403ac9181676
treedc5c6deead4478704d231447582bf850babd2b24
parent80156068eb4980342c0ad3ee47ac7261acce5caf
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 <hongzhen@linux.alibaba.com>
Reviewed-by: Sandeep Dhavale <dhavale@google.com>
Link: https://lore.kernel.org/r/20241202024019.85901-1-hongzhen@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
lib/xattr.c