mirror-linux/fs/erofs
Jia Zhu 79b09c54c6 erofs: fix metabuf leak in inode xattr initialization
commit bb88e8da00 ("erofs: use meta buffers for xattr operations")
converted xattr operations to use on-stack erofs_buf instances.
erofs_init_inode_xattrs() uses such a metabuf while reading the inline
xattr header and shared xattr id array.

Some error paths after erofs_read_metabuf() leave through out_unlock
without dropping the metabuf, so the folio reference can leak.

Consolidate the cleanup at out_unlock. erofs_put_metabuf() is a
no-op if no folio has been acquired, and this keeps all paths after
taking EROFS_I_BL_XATTR_BIT covered by a single cleanup site.

Fixes: bb88e8da00 ("erofs: use meta buffers for xattr operations")
Signed-off-by: Jia Zhu <zhujia.zj@bytedance.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Fixes: bb88e8da00 ("erofs: use meta buffers for xattr operations")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2026-05-20 14:53:14 +08:00
..
Kconfig erofs: update the Kconfig description 2026-03-25 00:04:41 +08:00
Makefile erofs: introduce the page cache share feature 2026-01-23 20:02:09 +08:00
compress.h erofs: enable error reporting for z_erofs_fixup_insize() 2025-11-30 23:49:32 +08:00
data.c Changes since the last update: 2026-04-21 11:16:04 -07:00
decompressor.c erofs: error out obviously illegal extents in advance 2026-04-10 16:53:39 +08:00
decompressor_crypto.c erofs: make z_erofs_crypto[] static 2026-01-23 00:00:18 +08:00
decompressor_deflate.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
decompressor_lzma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
decompressor_zstd.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dir.c erofs: fix the out-of-bounds nameoff handling for trailing dirents 2026-04-21 16:56:04 +08:00
erofs_fs.h erofs: handle 48-bit blocks/uniaddr for extra devices 2026-04-07 11:46:31 +08:00
fileio.c erofs: set fileio bio failed in short read case 2026-03-17 10:27:31 +08:00
fscache.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
inode.c erofs: include the trailing NUL in FS_IOC_GETFSLABEL 2026-04-02 16:08:49 +08:00
internal.h erofs: clean up encoded map flags 2026-04-10 16:53:39 +08:00
ishare.c lsm/stable-7.1 PR 20260410 2026-04-13 15:17:28 -07:00
namei.c erofs: get rid of erofs_kmap_type 2025-03-17 01:21:24 +08:00
super.c erofs: handle 48-bit blocks/uniaddr for extra devices 2026-04-07 11:46:31 +08:00
sysfs.c erofs: avoid some unnecessary #ifdefs 2026-02-03 11:25:55 +08:00
xattr.c erofs: fix metabuf leak in inode xattr initialization 2026-05-20 14:53:14 +08:00
xattr.h erofs: mark inodes without acls in erofs_read_inode() 2026-01-28 15:38:37 +08:00
zdata.c erofs: fix managed cache race for unaligned extents 2026-05-20 14:52:52 +08:00
zmap.c erofs: unify lcn as u64 for 32-bit platforms 2026-04-21 16:56:08 +08:00
zutil.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00