From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 953C53947AC for ; Tue, 11 Aug 2026 02:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786416235; cv=none; b=NfLSJYU1uodLzN+UblnYO20RI/vNQIHtXRyQ3T3k2guioaD1FO7SJtz7h7DuXMdvyp2hIO/zgO40JtDuz1VADOtBLMM9Hh9lulZF3Oaei4l4fiiByt4dokWdqZrfItEVwPMNDYJ0SAcb5YSMHREYR3YaDGYiW/mWS2Wu88gmsm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786416235; c=relaxed/simple; bh=I45dsT3xuoqipUSXlfx1FRXTh6Ib+OSWP+YuDS349FE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KVZ4wTt7t0tkZk6t6+QcUAkvGYLjX7gLsXPlJZzNE+kv7xm0hQvimezsL8ZF6Adyy9T2/WRsbXd0ALkHBseHZ9c31kF9D0G/TuvHF6ZKTS76xduNvUpgQaCzctc1o8GvVuhdoSucLlwsg56QG8Kra7VwUDcG5fjCyzRXChpK8rI= 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=l2qPQwFD; arc=none smtp.client-ip=209.85.214.177 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="l2qPQwFD" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2cc891373e0so30868695ad.2 for ; Mon, 10 Aug 2026 19:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786416227; x=1787021027; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=6ZvDsNGj0dOoEDAiBEEB1HZ1EThQVnZv7Q9QNTdwMqc=; b=l2qPQwFDPK3pSp9MvFkt5+ePCXUtTzs891oCqkkaw0Q9C/8OCoRMT4dt5lS9E+e3gI HOx+Hm4FmsnUc/FBBKAnFIZ7W85xbJLSnj6FMstElQkcZAIwsAT5dKcmJs8l3NwBCZci +CVmHgWDlyDlAt8Tnfqr5eFVqC3W8cWy7T9RW2Y4xUqOj9OyUxVCPUgnjFK9sQ2qtrUg 2xXcyV1qpUZp49GTy3+ir3QUE6AToGRuMBxF1Nz/FaznSpcyTS/UI9U6cK19kldFBW9O sCLWhkgTgVDy718nT58ZtMW2p5Sy0nK+XJyje887iZv8ECiva5X84qT9IPktV8C3XjQ2 Pecg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786416227; x=1787021027; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6ZvDsNGj0dOoEDAiBEEB1HZ1EThQVnZv7Q9QNTdwMqc=; b=bz7BDCfAeWg606X/6WnKIYCfjnbZprFMnUwERp6GQvLNj6ZuyQU41lI0L+hfTu5WR6 wrpxmNaC4vlf1G7eovsmpA31DubWHnLFbsbpbNm3n0qC7Kqec6KHP5LpcnrZTDGPVAHU OCC5kPaATJIxQgAfxKrnaqpv/X+SVKN8SHF8O7pAfhgBe/wKcyfOqlDkarr0JlS1Y7gA CltTR8s/WZKOtalzhi6lEI5PPfMRdQkNwSl7pbbrRvybYxLuXH06a5lPa3POy1Ld12HM 9MHevgvAMq3row1/GUEnM782BOAp/ObWC801luJPjalpU4JKflzW7FBrmxdqBRvLtCDs VgfQ== X-Forwarded-Encrypted: i=1; AHgh+RrAsjqbgkB7d6W3DHCx7FCwAsL5u3FQ7cTH4lP7e2G/Lb1U7AVlPRuk9GgBqLSRj7IebnqTK/5IPRiW9qM=@vger.kernel.org X-Gm-Message-State: AOJu0YzXRHCVa26DHqFbRsWVSZ7MFeX1C5QTmv64seC+TcodGpYHJtb3 1yxOF1fVv0r/gg8GR82XczdvDNOxUkiZmw+YtgbrPeeto25PMJPhp5Kw X-Gm-Gg: AR+sD10ihb24IdclnBk4h13uAY9s8RQ7OKZa4IZzQ+RfIoVZgZTXAVvnEBAK1f7j/Jf zqEWyfJcJiznKy8EaIHYhuNlioB4WbzFqL9kHNjOShxJNCLs2tKH+2Av7BP83s4Hm7ckbeVSRiF 8Qx14j8qxYh1Qihfryvbwt5VAnmIRksldabL9/HZzhPZjCdlNraT+bCRznyUKHhykMxOl2s+834 V8Xiv/s0F60KCOjkerLumxImXgD2bt+ZBIs3B+oJAGcT9ziu47oT8DzC0MGGwIPIWldkCwjVJGk vnglfQfPc1LG0Z/K4wIsK0WdiWoAugvJJzqWAwH9wDpi5DlovY4+wroE3eIdFjGpaRopMbZI2Rj 9VZtwiGJeTGrASA2xxDyy45ET6nQNz/Cw3wuI6niwNkOz89IkEkefXZY3xwgZ/km4gQiQkuj4zZ qbKoWpkBu3w5bzxh3u6zNZxlsUrXbUS6RpPXVpsuVx+qmi5jSpTVJL1oGHwyFW8YMN0p9WpIvQ X-Received: by 2002:a17:902:ea0b:b0:2c9:aae1:a611 with SMTP id d9443c01a7336-2d31798092bmr2076975ad.23.1786416226610; Mon, 10 Aug 2026 19:43:46 -0700 (PDT) Received: from osman.mioffice.cn ([43.224.245.178]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d3160f47easm464165ad.64.2026.08.10.19.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Aug 2026 19:43:46 -0700 (PDT) From: Zhan Xusheng X-Google-Original-From: Zhan Xusheng To: Andrew Morton , Joseph Qi Cc: Mark Fasheh , Joel Becker , Junxiao Bi , Changwei Ge , Jun Piao , Heming Zhao , ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, zhanxusheng@xiaomi.com Subject: [PATCH v2 0/2] ocfs2: bound-check both readdir re-validation scans Date: Tue, 11 Aug 2026 10:43:35 +0800 Message-ID: <20260811024337.3972976-1-zhanxusheng@xiaomi.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Andrew, patch 1 replaces ocfs2-bound-check-dir-entries-in-the-readdir-re-validation-scan.patch in mm-nonmm-unstable. Patch 2 is new. Both are against that tree rather than mainline, because the patch queued ahead of them rewrote the ctx->pos line that is now in patch 1's trailing context. v1 only bounded the position before de is dereferenced. Joseph pointed out that the walk has to stay inside the block as well, which is the second guard ocfs2_check_dir_entry() applies for the emit loop; patch 1 adds it. Checking whether anything else re-scans the same way turned up ocfs2_dir_foreach_blk_id(), which walks the inline data area and is missing both guards -- that is patch 2, which Joseph has not seen yet. Neither patch carries Fixes: or Cc: stable, matching the trailers kept for v1; please add them if you would rather they were there. Link to v1: https://lore.kernel.org/all/20260806122133.956847-1-zhanxusheng@xiaomi.com/ Zhan Xusheng (2): ocfs2: bound-check dir entries in the readdir re-validation scan ocfs2: bound-check dir entries in the inline-data re-validation scan fs/ocfs2/dir.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) -- 2.43.0