From nobody Tue Feb 10 14:49:31 2026 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CAFA37F0E4; Mon, 9 Feb 2026 15:24:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.157.23.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770650691; cv=none; b=DF4PBbgmJOcy1MsbeB5EcbVUccHd0kbCNNvVKLWhaLgCQhNpR0QTHtHAzLWILqt7XefqLH5ATZk8bjgfm+mUDOrUd08UQqlhR9TKFNZ3ZLFqFJBMHYLxP20UAqNoCXvFVcREdFaphWRnvAfgLkaBZ1vNLWG+WTOUOVlex4dA1kk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770650691; c=relaxed/simple; bh=FFXCc43I3tk/mxj/aCNjnGC7RY/QzOM1guMiQf3LESk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KuvmSvT63wg9xXh0n0DJMPWERanmcyMz3ZJLfCefj7Yivl+BmWg6yYblGZOYCdSY5iQrzjyfB5GBIOlzV4zodE8+rs+wp1t3chL8lR47OpmQtwUBHJUqjP2ORMfo3WSm7PqeGxrkQwyut9ikFKo7Afy5x39Z0tfPX2qZDiODaMk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=paragon-software.com; spf=pass smtp.mailfrom=paragon-software.com; dkim=pass (1024-bit key) header.d=paragon-software.com header.i=@paragon-software.com header.b=Z9HS0wFA; arc=none smtp.client-ip=35.157.23.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=paragon-software.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paragon-software.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=paragon-software.com header.i=@paragon-software.com header.b="Z9HS0wFA" Received: from relayfre-01.paragon-software.com (unknown [176.12.100.13]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id BB239241; Mon, 9 Feb 2026 15:22:42 +0000 (UTC) Authentication-Results: relayaws-01.paragon-software.com; dkim=pass (1024-bit key; unprotected) header.d=paragon-software.com header.i=@paragon-software.com header.b=Z9HS0wFA; dkim-atps=neutral Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id B28442187; Mon, 9 Feb 2026 15:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1770650689; bh=CYd5rcNnOaKSh23TI/e5OE/xbQ5AsdzUoPUlc04ix/w=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Z9HS0wFAFZ5byhJiHI/hGpRC4cxccP3znXOIYk90DbpxyqUjIXkfLI4e51fB9e7EF 5zL+rPFI3YEc65pMSNQMDYoJAlA1NOIL8XIECn+84PmKt0ANJYTlYzcHA2ttPoQvSE ui7ImzYVNinQdVwQReSFlMqT1gcLPXqmmSO/oI18= Received: from localhost.localdomain (172.30.20.159) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 9 Feb 2026 18:24:48 +0300 From: Konstantin Komarov To: CC: , , Konstantin Komarov , kernel test robot , Dan Carpenter Subject: [PATCH] fs/ntfs3: avoid calling run_get_entry() when run == NULL in ntfs_read_run_nb_ra() Date: Mon, 9 Feb 2026 16:24:40 +0100 Message-ID: <20260209152440.9832-1-almaz.alexandrovich@paragon-software.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20210824075819.GA13628@kili> References: <20210824075819.GA13628@kili> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) Content-Type: text/plain; charset="utf-8" When ntfs_read_run_nb_ra() is invoked with run =3D=3D NULL the code later assumes run is valid and may call run_get_entry(NULL, ...), and also uses clen/idx without initializing them. Smatch reported uninitialized variable warnings and this can lead to undefined behaviour. This patch fixes it. Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202512230646.v5hrYXL0-lkp@intel.com/ Signed-off-by: Konstantin Komarov --- fs/ntfs3/fsntfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index e9c39c62aea4..2ef500f1a9fa 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -1256,6 +1256,12 @@ int ntfs_read_run_nb_ra(struct ntfs_sb_info *sbi, co= nst struct runs_tree *run, =20 } while (len32); =20 + if (!run) { + err =3D -EINVAL; + goto out; + } + + /* Get next fragment to read. */ vcn_next =3D vcn + clen; if (!run_get_entry(run, ++idx, &vcn, &lcn, &clen) || vcn !=3D vcn_next) { --=20 2.43.0