From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 7A4063FD128 for ; Fri, 8 May 2026 15:34:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778254456; cv=none; b=h5US5opY6fYQ3hFY6JgpgC4X2jRkz2OExqpyW2DRRA32rm4PJPW8HM2l6btFfrHNsODJsDX/9DdtNkZgLbflFgjStjtq4G3aVY8uiA53SpW+wanpVJBx01E5NEMOsh6YvdL8Ty0/cLPo2thELtazYl2+QnXeh5QEmmAfA+qHQrA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778254456; c=relaxed/simple; bh=t8K7gf/SdY5lgBMtXy+Dl3HCLE0UZE9Ckhq0AbxW6kc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Duc4mrztq8EqBJ6PEXfaJYFGMTC96tALdRwIzZPgEqrD8iTYeSsGFJV3v1lcW5UowO0tOiOj5E0K5Sn0zc2rC35SmGcLpKKcaAXfdr5rgix5w6tRgpvcrXnkPa2gviDlzg5y3ROa9sa/aesSjPVPIZlkdXr5Ju6hx/YQjT3HKFA= 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=ms7IJ8oq; arc=none smtp.client-ip=209.85.214.174 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="ms7IJ8oq" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2ba21e7fb97so1346725ad.0 for ; Fri, 08 May 2026 08:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778254455; x=1778859255; 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=GEQuZu7m1VArIBC069EyXmSXyraygDC7mNMuy9iuhwE=; b=ms7IJ8oq2pB76UbfITh6tigcBMARY9ChyiLrh17l8hRbN3tnOM5i+nNt3ndZ6nU/jM u3oheNGmlV2H5sP7k54lTdWyBySdo1d5MKRy3GCfYO9einJR1Mne34w7XjBaXm8ayF4T lz5gBTS8iVKdZ/VJJy3bse7Ng74cZDL5lx6+QFOvJRYFbRyYLXMXYRAFrjKEfxKSWPoW Ru9SmdvF1D3J0poxvU5+TPH8nc5Prys50XN4JkQIi+s4dWhhnKptXmZzKk3AMjP1DFmZ wJY//o/H8nfcY6uqFN0MLAWvEuBj356NYB4cWhR/tHoUQ/XR9/LpbGMdYuY1+fFZ2uFa gaow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778254455; x=1778859255; 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=GEQuZu7m1VArIBC069EyXmSXyraygDC7mNMuy9iuhwE=; b=KBrWLzeo7YbNFvpLMZwmQKJFCmpusRcsaxeaIwHACCIHoXlJzGI8xDGBK4pEibrUew 3bCFuPiEcYS3ocx+8FxkT9BM38fvw2L5SP8Fw9rEJyTvx85bsU34aUVA3Er0TneXXyMe 2fMFr5EMrddSmW2N7b/YmxK1isJLV0wuOZ1grURb8GxKU6huPxlK26vBgUPaypSy+F/w yESuuhb0Kpr7v4m90ashohW28HXfyH55E8K4jXc8Z3GPbTFxraNJre3DoYAvhLbYUwYK zdii4ZgKccmPi+t+/B2KxJdN7Lt9hOQG8SVQbjsBgDAP/A6S6gGhoQlhS3yolULH0LAt DWSg== X-Forwarded-Encrypted: i=1; AFNElJ+OdxV9BxLxU15ftXjsF2+664gxiZlYPHRhya2potINKcMex/36SGs3EZO7LSKhDJPjmXdkET+JjBbtJhg=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/7JEqKaZewXs9Mul6tQ6cQmLHAkV5vDeUA4VpGELFKzaOqkS0 m+PJxddH1qzzRc7hsw0jO/Ad+4dFbOOivBaL2ytiyqav3nXGpirLyuw3 X-Gm-Gg: Acq92OGX8lQq07qsbChMTgTYxHse7eVrA31iCnZL9C4i9CeMRqXIB8pC1Vd0QSx000y u58Oc7OhVwSReeK5MbpqLYIRcPi0QtANGGb27X2w7cxInxJVILFvp6Wr9tzoMVDoCpPwZrKu86L pzKGG57NcVikLQUKQzDnYutNkUal6qqFpSR51/hJAALlgPmQM0vvheZVGqtJ8E0iCm+GOKKqGKe 0NiotZ4HmhZ9VvPx9zno6w/m6ydIogl3DxFyRe1E8n0LtLuFnh8GQzKWjF6hu29CHr9ZfH99N7t buiIM/dyO15xWEQ/XhuyEKuz73fmq51FGc80lyvnSPa/gGwdjjwO2bF9l4us6cS0bEM8Fri710O K1K3OU79d4SdN2tdS2B1pMt6UX1sH4UIbIBXzxjJjVTA1zum2jA2fS16QrjKhQFfNBf4MRPDq+4 2VPvfEB5JmjVyUn2yA X-Received: by 2002:a17:903:32d0:b0:2b4:5a2e:98d6 with SMTP id d9443c01a7336-2ba7b344651mr65610595ad.5.1778254454668; Fri, 08 May 2026 08:34:14 -0700 (PDT) Received: from ser8.. ([221.156.231.192]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1d4094fsm26666365ad.19.2026.05.08.08.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2026 08:34:14 -0700 (PDT) From: DaeMyung Kang To: Namjae Jeon Cc: Hyunchul Lee , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] ntfs: harden MFT record and attribute parsing Date: Sat, 9 May 2026 00:34:07 +0900 Message-ID: <20260508153410.2624801-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 This series tightens fs/ntfs against malformed on-disk metadata and fixes one off-by-one in the MFT bitmap scan. Patches 1/3 and 3/3 are complementary: 1/3 rejects MFT records whose attrs_offset points past bytes_in_use at record entry, and 3/3 moves the per-attribute name bounds check earlier so it covers the AT_UNUSED enumeration path that hands the name pointer back to callers. Without 3/3, two enumeration paths can read past an attribute record: one in fs/ntfs/attrib.c passes the returned name pointer to ntfs_attr_iget(), and another in fs/ntfs/inode.c copies the name while building an attribute list. Patch 2/3 is independent: ntfs_mft_record_layout() rejects mft_no >= 2^32, but the bitmap scan in ntfs_mft_bitmap_find_and_alloc_free_rec_nolock() used '>'. Bring it in line with the other 2^32 boundary checks in fs/ntfs/mft.c. All three carry the same Fixes tag (d3ad708fecaa) since the issues date from the initial fs/ntfs commit in this tree. DaeMyung Kang (3): ntfs: validate MFT attrs_offset against bytes_in_use ntfs: fix MFT bitmap scan 2^32 boundary check ntfs: validate attribute name bounds before returning it fs/ntfs/attrib.c | 25 +++++++++++++++++-------- fs/ntfs/mft.c | 16 ++++++++++++++-- 2 files changed, 31 insertions(+), 10 deletions(-) -- 2.34.1