Skip to contentSkip to conversation

ocfs2-validate-inline-xattr-header-before-ibody-remove.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message May 29

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: ocfs2: validate inline xattr header before ibody remove
has been removed from the -mm tree. Its filename was
ocfs2-validate-inline-xattr-header-before-ibody-remove.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: ZhengYuan Huang <[email protected]>
Subject: ocfs2: validate inline xattr header before ibody remove
Date: Fri, 8 May 2026 16:59:12 +0800

[BUG]
A corrupt inline xattr header can make ocfs2_xattr_ibody_remove() pass an unchecked header into ocfs2_remove_value_outside() during inode xattr teardown.

[CAUSE]
ocfs2_xattr_ibody_remove() still rebuilt the ibody xattr header directly from di->i_xattr_inline_size and then handed it to code that iterates xh_count and entry geometry.

[FIX]
Validate the inline xattr header with the shared helper before handing it to the outside-value removal path, and propagate -EFSCORRUPTED on bad metadata instead of traversing the unchecked header.

---

 fs/ocfs2/xattr.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
fs/ocfs2/xattr.c renamed from fs/ocfs2/xattr.c~ocfs2-validate-inline-xattr-header-before-ibody-remove +3 -3
@@ -2476,9 +2476,9 @@ static int ocfs2_xattr_ibody_remove(stru
 		.vb_access = ocfs2_journal_access_di,
 	};
 
-	header = (struct ocfs2_xattr_header *)
-		 ((void *)di + inode->i_sb->s_blocksize -
-		 le16_to_cpu(di->i_xattr_inline_size));
+	ret = ocfs2_xattr_ibody_lookup_header(inode, di, &header);
+	if (ret)
+		return ret;
 
 	ret = ocfs2_remove_value_outside(inode, &vb, header,
 					 ref_ci, ref_root_bh);

_

Patches currently in -mm which might be from [email protected] are