Skip to contentSkip to conversation

ocfs2-validate-inline-xattr-header-before-checking-outside-values.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 checking outside values
has been removed from the -mm tree. Its filename was
ocfs2-validate-inline-xattr-header-before-checking-outside-values.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 checking outside values
Date: Fri, 8 May 2026 16:59:11 +0800

[BUG]
A corrupt inline xattr header can make ocfs2_has_inline_xattr_value_outside() walk xh_count from an unchecked header while refcount-tree teardown decides whether inline xattrs still point outside the inode body.

[CAUSE]
ocfs2_has_inline_xattr_value_outside() still computed the inline header directly from di->i_xattr_inline_size and immediately iterated xh_count. That is the same unchecked metadata boundary as the ibody lookup bug.

[FIX]
Reuse the shared inline-header helper before iterating xh_count. Because this helper returns a boolean-style answer to its caller, treat a corrupt header conservatively as "has outside values" instead of walking it.

---

 fs/ocfs2/xattr.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
fs/ocfs2/xattr.c renamed from fs/ocfs2/xattr.c~ocfs2-validate-inline-xattr-header-before-checking-outside-values +4 -3
@@ -989,11 +989,12 @@ int ocfs2_has_inline_xattr_value_outside
 					 struct ocfs2_dinode *di)
 {
 	struct ocfs2_xattr_header *xh;
+	int ret;
 	int i;
 
-	xh = (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, &xh);
+	if (ret)
+		return 1;
 
 	for (i = 0; i < le16_to_cpu(xh->xh_count); i++)
 		if (!ocfs2_xattr_is_local(&xh->xh_entries[i]))

_

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