From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4801D372EDE for ; Thu, 25 Jun 2026 09:01:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782378067; cv=none; b=PkhVcWIlG2Jc7Aq+2y8XQN4d5Q8fxPw/Zc36ZE8KP+ZYpgpehnMkgLY9vE84MgTFImV2vUq/hSI1H++A9CJtCBsn+LrUzszMqcF0PLewORbhs5rKQfJVl2mVLslm1Ireyhmsc3ZjHesoia4U33dU9sqBuoCNnM/cdO8SUmk2GmA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782378067; c=relaxed/simple; bh=qG+8UNzb7n1IcZkwZljOYHzy0X8AZwiYkKgSc99r3dE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SVnYmMV73Wzu4NMkcJnTHfOO+fdNsfBxVrpDbIdda8uavkC9omUaVUCpnNR4wBbJ1ciXeQXG4vapVrM5900N0HU6OkEuJZfew5fUfOWF4gJX4jtPaVIhjOuYv7sC6MzoVFXscecs3nLM+9MbkMr7MWwDNP/l5k1AJBLtnZjusHc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Z2dc3lad; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z2dc3lad" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2c7c61b5292so12146535ad.0 for ; Thu, 25 Jun 2026 02:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782378065; x=1782982865; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0LKkASNlVuvhKQZtByk6KxhNC77KfLjasF4hXylrFP4=; b=Z2dc3ladGdKniBpBbtwrXf0ApSeWUwEyUaD4+y+UaWwYnAmUIeQnGOZjDdBmNxR9xb Ux0lO0+bRDvUhKA6w1FhYK3etBIOwyXBr3fDeebRXC9/iKBa/xNMUa8B0RcHNDCbpQEy k6yckSSc8pTm5FfQc5hDnyOm4p/sdflHNh76AwlgbSsfkWNu296kTZdBS8IM/ePaWG5Y jf0E8I5Fz74uHgAem/ba9Bj9LYgdtXcnzj69RsZAdFrG0gwbUTN9ItrS2/9dSyKf5zuq kIvbntUHH3/0dlUCr/qajFTKuJr6ENf6gK04294+F2tfYOIc6P21qJYw/lzg1NaWxg5B AkZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782378065; x=1782982865; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0LKkASNlVuvhKQZtByk6KxhNC77KfLjasF4hXylrFP4=; b=DxK9CHphXw5wUJmCcPnAqwounm7sZVUuji64RDw83tktNU6DWnwiVElOQgKGN/uf8f BXoukcJtJ/k59s4LweJz7CJ9fmePD5WmQcnBLZLWNhEQgJz3ehY76ANE7stsxvBudHop sAHYYMbiq1d9y8Ez7Ssv0rCx639MIP0FFnIreUMm9VKNPxtchC8RxCD8ybkxULGPrXH5 CoWq4W3OIczseXt/WU5qKCHB02MWrIXvcib/5W+7GnsBLtBbB/2od4sqAEqsnrydwOaq sqjPO+Wi1obV9+e3GSbS5RyXXrTMjT730OHyNnNj8iQ6PuJsK+Wx32GJSJJL8X60ry2m Rs7w== X-Forwarded-Encrypted: i=1; AHgh+Rp+QUTCu3YpamwT7UOFw+2j2wBuKYlq8uVNeZZc/6Wx8OSn+PY1ONzhz31hECscZy4vLH4B1vVgh0eUnws=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1pbFf0Qis4D6GcM3GvjntjzW+5I4Gt5axFmC5eAqlf20Nc+Vm okB3B3kx8KqYSpM0bFS8Hun3YqkaQ4UQv9HvNBdFakC5nO12dNiCI6ni X-Gm-Gg: AfdE7cnsZp3XZuSYswiWYDdWhY7eazsEQ5YEFZiA2ViBOsF4u3f5IyXJA04TU1WTVhY 5Yofmfy9GaRqwBVeLwE59oBiEL//D3aEYs61/MHvmjacZZHbIJgG3f9f8uem9lDtv88s72XLm2M sl9lZzPQzBqO4ROHhjWd/aksVhN76fx7jyXIjhFnI+DZC3pUgp158pjQ7Y5NL1UW75WyqNbooe5 wi6lqRk05UfwDSwCA4defUkTC+fFsMHZVci3jLNhvyAmLfpp5kTjs5cn9wZVPjhy8yKdlT+d00S ig9xT7iKHzFxiPwc69BILgYG8HMOhG708VXeJux2bmSOJB5RtGweY8v93v2Wqvj/Mlc9zgRYYNY I8N93Intdek6+DIkRgw7RH+zK62G2kD+AHJxeQZfuvM/29lZYqoU6G1K5STB48m0bGHGOPQzQ+v XJUhs26IM= X-Received: by 2002:a17:903:1cb:b0:2c7:f227:58ee with SMTP id d9443c01a7336-2c7fca717bdmr12865865ad.22.1782378065269; Thu, 25 Jun 2026 02:01:05 -0700 (PDT) Received: from localhost ([111.228.63.84]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c7f6518bb1sm15365715ad.84.2026.06.25.02.01.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2026 02:01:04 -0700 (PDT) From: Cen Zhang To: Joseph Qi , Mark Fasheh , Joel Becker Cc: ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, zzzccc427@gmail.com Subject: [PATCH v5 0/2] ocfs2: validate xattr entry bounds Date: Thu, 25 Jun 2026 17:00:58 +0800 Message-Id: <20260625090100.202881-1-zzzccc427@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260622130332.2094018-1-zzzccc427@gmail.com> References: <20260622130332.2094018-1-zzzccc427@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, This series validates OCFS2 xattr entry name/value bounds when xattr metadata is read and validated, before getxattr() or listxattr() can walk out-of-range entry arrays or offsets from corrupted metadata. Patch 1 validates inline xattrs from ocfs2_validate_inode_block(). Patch 2 reuses the same entry validator for non-indexed xattr blocks and indexed xattr buckets. Changes since v4: - Replace the descriptive string argument with enum ocfs2_xattr_entry_type. - Drop the new per-operation full inline-xattr re-check; operation paths keep their existing ibody header/count lookup, and full entry bounds validation now runs at inode block read time. - Simplify corruption messages to rely on the corrupt block number instead of also naming the xattr storage kind. Cen Zhang (2): ocfs2: validate inline xattrs during inode block validation ocfs2: validate external xattr entries when reading metadata fs/ocfs2/inode.c | 4 + fs/ocfs2/xattr.c | 194 +++++++++++++++++++++++++++++++++++++++++++---- fs/ocfs2/xattr.h | 2 + 3 files changed, 187 insertions(+), 13 deletions(-) -- 2.43.0