From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.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 E8BF324A07C for ; Mon, 8 Jun 2026 15:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780933770; cv=none; b=Bp2pyWN6sY9OvUnJybv4Tua67qN4TNHoRe5b6X/ZMKjPoEf/pNFb4iKNKSjyXV513+YteNVmivU+5zBQ8qusWAVUBl266JZEf7maKf2JEcYc57noFqW+5EGNJLlpUpE3jswTUxVsdv9E/LqeLT1Y4TFpFBKkMyDUtWugpEqzwpg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780933770; c=relaxed/simple; bh=5RZ0q9GBw4BddYSwEQNkwJXmfz6KXYHDKBEbwwKM0JU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gJvfx3h38mXj7phjq4FvL0OZDZNoTN6QWDyzFUSUeIKOj8gVmEOzAhbAUUfzFrLpscqXslC9dPb9u6fh/HC8GD+NInliNe21JenlyqTMhsMlx1o90eZWfbxLY7vtP8iCgkGt90K26R30kTm/5tNeT3i4sBm3CvbA6LOjjBEogW4= 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=LgUD4ahP; arc=none smtp.client-ip=209.85.210.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="LgUD4ahP" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-8423f52cd57so126345b3a.2 for ; Mon, 08 Jun 2026 08:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780933767; x=1781538567; 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; bh=L9Q/wvt/PJjPoRpqikIilrV4ar4F5+3eDDF7cIerGlQ=; b=LgUD4ahPxdF5NaiU0WEZZbgfkggO52m200neWx268U31JwYsrWphwF1ma6WuCBbSmY vY/Wu2Y+XQ6oNI8Vv9/tObqzEXLaqsHn8D5lM+9jBPpimeVQnZMTj6BsFtyyShdO8frs IRXLs3z9r9F5UIrR/Tr/BE7Jd0KV7jxj62+IW0dkKEofpKEU8hB7rEE7b9FXz71yZgGd VtmAWk6l2SdgVMNbSUJYAoMtlhFfrbj1Zy4O7x0l6uxeYTKLfdTRBUd2HhpqP2orX0Xd 81Vom/b/opotP0ok5jLko5T6HUksK18+KlTn2kIgGaGB+gTUJcUCNgMT9+0eYqjePnxG 3TqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780933767; x=1781538567; 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; bh=L9Q/wvt/PJjPoRpqikIilrV4ar4F5+3eDDF7cIerGlQ=; b=ChmW7pqguuDoJafJ3rSkZ16at885vsmLBsoOvoxIbOYhtpk7QzZleVqTI8WE5KvatK +Or26a7zjTek2egCOInppsvRV2426KYHzdf9WNLotXNtwPgGeMkakoqLMLTRlzEPm4kS Obu6EgpdzCVlRY1f2FE8muDLg0LmmUttqaKRXegvvoNJRmmxXq5vhjsNTrmmY7fMTOHc BC0bv6Z55bVulBctUmcdBcO6UkccRDNs99mXnOI5HBDpfygH7Jl9SlxpjfitQgstRr8F Ue0MR3n1y6XLD51JXGXJbOOZVf7YoE+PsspfvWv4x3m2wIaX51yzrlwp8Eqv56hRyR2h 1Lqw== X-Forwarded-Encrypted: i=1; AFNElJ+LULiqx12+EqVSvajEVY9EGgogaa/D8fOwXmb4LzVStSA++Tp5LfH0pe2I1JpEa0O78/rvt+MquKkm6Yk=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0A1HRhGDfz7Bb+l9msbQTdihWcnxsXJ6nyoadcqsMRAE4Mgh+ C4dvjrflVvM4RFUWvd9hoBQDKtiAu6U39T1aEPX5dwZrmn5L0Pvm7K80 X-Gm-Gg: Acq92OGClQtKQMuJUOD0TbhBeuUHHdHzIpKqHgLxPv4Fx+f65pZVZWa/R4dskWFNVHA ZV4umheG0R0xmK2TRRV+v0EfBSjbNNsF9cfv0+7oR/3dDNwkw74ZQZsjDOiPQBhLmYCO32VwGis bNk0khGrgdLVRO5NAsYvKWiOrC4qMMm0/NffevXqAKLAIrOA9qehTe4HT8ClPGIulEukkvdu70w rQr0mMbXDUvANAt6aFBwB6aO2MiW0glBKMXuqxXJnOl7PyIbaZvX/toO5xQID8BkjqAQH39MR5T i9VsyNb9gn5sIBJ0UBe5jSR4ksnFaExB0Q5BHlNBAaUbtpw6lLf9KyYZDw0zmIbeQFsFi4Q8XRd 8GyROGTtoCY2nubIRFrETIGnFfIK3wEHOhs0Rpbq5+9Q46RbFVm7UJwSQZ0MKW8NS6NR+YBNynC v8f/hCLZ+ckVaPciNqy8cgNCmNxo4= X-Received: by 2002:a05:6a21:6f89:b0:3b4:6f05:8301 with SMTP id adf61e73a8af0-3b4cd48fbd0mr8679527637.7.1780933766975; Mon, 08 Jun 2026 08:49:26 -0700 (PDT) Received: from ser8.. ([221.156.231.192]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c85df0a624fsm15937526a12.18.2026.06.08.08.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 08:49:26 -0700 (PDT) From: DaeMyung Kang To: Namjae Jeon Cc: Hyunchul Lee , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, DaeMyung Kang Subject: [PATCH v6 0/4] ntfs: finish resident attribute lookup validation Date: Tue, 9 Jun 2026 00:49:13 +0900 Message-ID: <20260608154917.2703739-1-charsyam@gmail.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 Hi, this is v6 of the remaining NTFS resident attribute lookup validation fixes, rebased onto the current ntfs-next branch from git.kernel.org. v5 was generated against the temporary linux-ntfs ntfs-next test branch, where the earlier lookup validation patches and the initial resident $INDEX_ROOT validator were already present. That made the final allocated_size-only patch depend on context that is not present in the official ntfs-next branch. This version is generated on top of: git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs.git branch ntfs-next base: The current official ntfs-next branch already contains the earlier shared attribute-value validator, the volume-name error handling fix, the volume information search-context reinit fix, and the resident $VOLUME_NAME validator. This resend therefore contains only the remaining official-base delta: - reject non-resident records for all resident-only attribute types; - fix the $INDEX_ROOT grow and shrink ordering so header capacity never exceeds the resident value visible to lookup-time validation; - add the full resident $INDEX_ROOT lookup validator, including allocated_size checks. Changes since v5: - Rebased onto the official git.kernel.org ntfs-next branch instead of the temporary out-of-tree test branch, so the series no longer depends on patches that only existed there. - Patch 4 is now a complete resident $INDEX_ROOT validator. In v5 it was an incremental allocated_size-only change on top of the out-of-tree validator; the resulting validator function is unchanged, but it now stands on its own against ntfs-next. - No functional changes to the other three patches. Testing: - Applied this 4-patch series on top of the ntfs-next base above with git am; git diff --check is clean and scripts/checkpatch.pl --strict passes on all four patches. - Built a KASAN kernel (CONFIG_KASAN=y, CONFIG_NTFS_FS=y) and ran it under QEMU against fresh 512 MiB NTFS images: mounted each read-write, created 12 directories and 2160 files, then renamed, removed, cleaned up and unmounted. Repeated three times; no KASAN report, oops or panic, and ntfsfix -n reported each image clean after every run. DaeMyung Kang (4): ntfs: reject non-resident records for resident-only attributes ntfs: grow index root value before reparent header update ntfs: update index root allocated size before shrink ntfs: validate resident index root values on lookup fs/ntfs/attrib.c | 49 +++++++++++++++++++++++- fs/ntfs/index.c | 96 +++++++++++++++++++++++++++++++----------------- 2 files changed, 111 insertions(+), 34 deletions(-) base-commit: b3f6cd1d54aa279cc4f47aa27939ebe517a2c390 -- 2.43.0