android_kernel_motorola_sm6375/fs/ext4
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ahmet Eray Karadag ea39e712c2 ext4: guard against EA inode refcount underflow in xattr update
commit 57295e835408d8d425bef58da5253465db3d6888 upstream.

syzkaller found a path where ext4_xattr_inode_update_ref() reads an EA
inode refcount that is already <= 0 and then applies ref_change (often
-1). That lets the refcount underflow and we proceed with a bogus value,
triggering errors like:

  EXT4-fs error: EA inode <n> ref underflow: ref_count=-1 ref_change=-1
  EXT4-fs warning: ea_inode dec ref err=-117

Make the invariant explicit: if the current refcount is non-positive,
treat this as on-disk corruption, emit ext4_error_inode(), and fail the
operation with -EFSCORRUPTED instead of updating the refcount. Delete the
WARN_ONCE() as negative refcounts are now impossible; keep error reporting
in ext4_error_inode().

This prevents the underflow and the follow-on orphan/cleanup churn.

Reported-by: [email protected]
Fixes: https://syzbot.org/bug?extid=0be4f339a8218d2a5bb1
Cc: [email protected]
Co-developed-by: Albin Babu Varghese <[email protected]>
Signed-off-by: Albin Babu Varghese <[email protected]>
Signed-off-by: Ahmet Eray Karadag <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2025-10-29 13:59:54 +01:00
..
acl.c
acl.h ext4: apply umask if ACL support is disabled 2023-11-28 16:50:21 +00:00
balloc.c ext4: reorder capability check last 2025-06-04 14:32:31 +02:00
bitmap.c
block_validity.c
dir.c ext4: fix OOB read when checking dotdot dir 2025-05-02 07:39:24 +02:00
ext4.h ext4: avoid ext4_error()'s caused by ENOMEM in the truncate path 2025-02-01 18:18:53 +01:00
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h
extents.c ext4: fix calculation of credits for extent tree modification 2025-06-27 11:02:51 +01:00
extents_status.c ext4: make sure allocate pending entry not fail 2023-12-08 08:44:24 +01:00
extents_status.h
file.c
fsmap.c ext4: correctly handle queries for metadata mappings 2025-10-29 13:59:54 +01:00
fsmap.h
fsync.c
hash.c
ialloc.c ext4: avoid negative min_clusters in find_group_orlov() 2024-11-08 16:20:30 +01:00
indirect.c
inline.c ext4: do not BUG when INLINE_DATA_FL lacks system.data xattr 2025-08-28 16:21:27 +02:00
inode.c ext4: increase i_disksize to offset + len in ext4_update_disksize_before_punch() 2025-10-29 13:59:54 +01:00
ioctl.c ext4: fix to check return value of freeze_bdev() in ext4_shutdown() 2023-08-11 11:53:47 +02:00
Kconfig
Makefile
mballoc.c ext4: fix FS_IOC_GETFSMAP handling 2024-12-14 19:44:35 +01:00
mballoc.h ext4: fix FS_IOC_GETFSMAP handling 2024-12-14 19:44:35 +01:00
migrate.c ext4: fix i_data_sem unlock order in ext4_ind_migrate() 2024-11-08 16:20:39 +01:00
mmp.c
move_extent.c ext4: fix double-free of blocks due to wrong extents moved_len 2024-02-23 08:25:11 +01:00
namei.c ext4: fix off-by-one error in do_split 2025-05-02 07:39:15 +02:00
page-io.c
readpage.c
resize.c ext4: fix corruption during on-line resize 2024-04-13 12:51:26 +02:00
super.c ext4: don't over-report free space or inodes in statvfs 2025-05-02 07:39:24 +02:00
symlink.c
sysfs.c
truncate.h
verity.c
xattr.c ext4: guard against EA inode refcount underflow in xattr update 2025-10-29 13:59:54 +01:00
xattr.h
xattr_security.c
xattr_trusted.c
xattr_user.c