From nobody Mon Apr 6 14:55:33 2026 Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) (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 44667284880 for ; Thu, 19 Mar 2026 05:31:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.69 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773898272; cv=none; b=W82GHkiH1A5gYAEXWCpIl4rFdHdy0I6IWYBXLNZF4+4hcAfS6HIycEuEDSp8J33i9zjlAT1qcoegDPFFkyU/Ef0MuuEWmNNpKAFAG8F/Ij1TDF3FftMLQbDyeXsUpJ6Mx1LGKaHKYVlUj+7EQdkWtrSp6aFqtgaRO0cPBwcJy8E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773898272; c=relaxed/simple; bh=UMqMNZfjKeY6nyfwZBWjyItxODK5N8aWpsgzkifL648=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=dHO0fBvtD595/6XouFgGuFS1ScK2QdzePFpj51H9mbHFc6i0bhvq4/W2bWGE97OoGGQ2lOVK1rQaXajizAEK6UTpbhEfixPZUYKbcuaU/ZznHzNOlDN/V8S9PTlP4T3BywRICic696VrmUHN+ZPenfcAzdboAczzrMIYeV/I0BQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f69.google.com with SMTP id 006d021491bc7-67bb7ed941fso5000717eaf.0 for ; Wed, 18 Mar 2026 22:31:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773898270; x=1774503070; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cxchy99iCLVWDIDcdRNBa/sLESr/a+5y/gakHiygPV0=; b=foSTZ25kERUw78VkVrT16pshhBwRiXBZ6Dfwh87oak5hoViWY9jU+vaHh82r1egClm M8kGyuNcQdJ56GRPr5vDgXoaphBIcuDiVilx3SiqqBXtESF3WqD8d2U+6eW8KtngPWvX 4gmeDRqQBccBZKYHRDiCUdr/xdewoshVYZgU1NU8Or+ggOdnx3RufnVTuRhkLRpHnVvV Rfi2JIJI4KhWivNDk4s1IhyXQOR0vHFmV9AKIeZHkUZc0k3eqmV21+IWxqTZXy1fKUSO XiBaJWEg7aKNPGpT3RxlYIstl85TczSgl/TcTft5UTdYdnBrHiCULz+7vCJ93pNufvji a4MQ== X-Gm-Message-State: AOJu0Yy03EqBz4/lwe+rmgizEHZK6yM89Kjl+Z03uQ2cX8WMSkFjo3xg R+6oyp1RjD6Z4H5DPCbORif1257zTrXkVNyZxUeuddOK1zbVIbeeenuIcduR56XgYh+PDR7G8FL y7WhS7P+7wzJ/QIJtI8kZ26skTzUfdyyoW4uR2obP3W36cZvzgMDELzetMm0= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:440b:b0:67b:dd9e:f50 with SMTP id 006d021491bc7-67c0daf79d5mr3217308eaf.42.1773898270108; Wed, 18 Mar 2026 22:31:10 -0700 (PDT) Date: Wed, 18 Mar 2026 22:31:10 -0700 In-Reply-To: <699c406b.050a0220.1876f9.0002.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69bb8a1e.050a0220.1b2d94.0006.GAE@google.com> Subject: Forwarded: [PATCH] fs/ntfs3: fix missing run load for vcn0 in attr_data_get_block_locked() From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] fs/ntfs3: fix missing run load for vcn0 in attr_data_get_b= lock_locked() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master When a compressed or sparse attribute has its clusters frame-aligned, vcn is rounded down to the frame start using cmask, which can result in vcn !=3D vcn0. In this case, vcn and vcn0 may reside in different attribute segments. The code already handles the case where vcn is in a different segment by loading its runs before allocation. However, it fails to load runs for vcn0 when vcn0 resides in a different segment than vcn. This causes run_lookup_entry() to return SPARSE_LCN for vcn0 since its segment was never loaded into the in-memory run list, triggering the WARN_ON(1). Fix this by adding a missing check for vcn0 after the existing vcn segment check. If vcn0 falls outside the current segment range [svcn, evcn1), find and load the attribute segment containing vcn0 before performing the run lookup. The following scenario triggers the bug: attr_data_get_block_locked() vcn =3D vcn0 & cmask <- vcn !=3D vcn0 after frame alignment load runs for vcn segment <- vcn0 segment not loaded! attr_allocate_clusters() <- allocation succeeds run_lookup_entry(vcn0) <- vcn0 not in run -> SPARSE_LCN WARN_ON(1) <- bug fires here! Reported-by: syzbot+c1e9aedbd913fadad617@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=3Dc1e9aedbd913fadad617 Signed-off-by: Deepanshu Kartikey --- fs/ntfs3/attrib.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index 6cb9bc5d605c..6ef7db82a35d 100644 --- a/fs/ntfs3/attrib.c +++ b/fs/ntfs3/attrib.c @@ -1152,6 +1152,20 @@ int attr_data_get_block_locked(struct ntfs_inode *ni= , CLST vcn, CLST clen, if (err) goto out; } + + if (vcn0 < svcn || evcn1 <=3D vcn0) { + struct ATTRIB *attr2; + attr2 =3D ni_find_attr(ni, attr_b, &le_b, ATTR_DATA, NULL, + 0, &vcn0, &mi); + if (!attr2) { + err =3D -EINVAL; + goto out; + } + err =3D attr_load_runs(attr2, ni, run, NULL); + if (err) + goto out; + } + da =3D false; /* no delalloc for compressed file. */ } =20 --=20 2.43.0