From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385006; b=SPGJ67dEfNn2AisLVonBIedJM/RuyTDjwQioBIbSRwdrMOmghV/ZM7yt8PqbkXEqHf2f 73KUR7OAfQtfP+SwMH+/l3tO1YznGBenh8Cb8c1TQ6jnA/e6fqBZzhtN23gjjmuO61LNU /kuyTw6oZGLjecIDxxkU8ULmyb1HK/hI2vH1Q3bB7PcOOQ2e9ffxw89PcBES43hFiK8BO mVtQAukSzTshgYSODkVq+Q1UWkBv1vc6WN9x2iY5VdGfzoBLQ02gKKAvAQ+RAJ5S+B6Ue tBkMavsm9Bt0duRB2o6AMvvKXAa5/D7QJTbpB9gxmKjAh1fmYo/qRFPc2NGjicR9Sgg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385006; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=He503HVezFlzZsPSmDPO2Kyr+TyO10yWbTFlrZjDkyw=; b=QjCM24i4SeXyGqj2hCxferZWx1+NTqi67AOY0KoBJQXQgjEe13Fbd03odwmfS3wg+hIV 4EjNsUQ5el6wzWbNATat1egGIN3AmhRZzVGkGoz/KC6lpasAYbxIhFQGnyzTz/sDhGfF6 KlVvdk/q79HcMbMKBAdz1mvwJTKoODT+bwr2pJ1NAyUnmI5PVZIsEzzMshbYIedufkod9 K9hTBjwpXHj9J11RqLREZp0T9NmDjFF+Q5vsm3Ke+QYwNct2E2K2dsnvxiwy2VdUs0X6T n3mysYcQbF0IHwY1WmlOkBI4sAd+a2J+mnePT7SpqMSuwPe/BepQqrEB4NH9N6ANyoQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=kHH0Cunp; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45E28606A682; Fri, 4 Dec 2026 11:50:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=kHH0Cunp Received: by smtp.kernel.org (Postfix) with ESMTPSA id B28AF1F000C2; Fri, 4 Dec 2026 11:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385006; bh=He503HVezFlzZsPSmDPO2Kyr+TyO10yWbTFlrZjDkyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kHH0Cunp16AbGwbkQZfIsaqeLOqKpeqs4HHRqIhEmVOf1yMG0ojsdpGo3EbtGJGvy V4rxs7nY/v55S19CmBINKcscwMq0M6UMYzgkMR63z983GKPG1HV3cmEmGp7lsUxq2W G4oC/ecvaMhHRtnayVQwNt7rTqjEFX/YaKCePghM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dmitry Morgun , Konstantin Komarov , Sasha Levin Subject: [PATCH 6.6 0382/1167] fs/ntfs3: check return values in indx_delete_entry() Date: Fri, 4 Dec 2026 18:56:49 +0900 Message-ID: <20261204100711.963008882@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Morgun [ Upstream commit 131f7d7abf0f10edc6ea6b032f8a3908bdb13ce8 ] When the index tree collapses down to an empty root, indx_delete_entry() calls attr_set_size() and ni_remove_attr() for both ATTR_ALLOC and ATTR_BITMAP, but their return values are overwritten by the following call without being checked. In most other call sites of these functions the return value is checked, so add the same checks here in case an error at this point is meaningful. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Dmitry Morgun Signed-off-by: Konstantin Komarov [ sashal: Added a trailing NULL argument to the attr_set_size() calls to match this tree's 9-argument signature with the extra ret parameter. ] Signed-off-by: Sasha Levin --- fs/ntfs3/index.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c index 632e526187048..e32a6a0560e5c 100644 --- a/fs/ntfs3/index.c +++ b/fs/ntfs3/index.c @@ -2693,18 +2693,28 @@ int indx_delete_entry(struct ntfs_index *indx, struct ntfs_inode *ni, err = attr_set_size(ni, ATTR_ALLOC, in->name, in->name_len, &indx->alloc_run, 0, NULL, false, NULL); + if (err) + goto out; + if (in->name == I30_NAME) i_size_write(&ni->vfs_inode, 0); err = ni_remove_attr(ni, ATTR_ALLOC, in->name, in->name_len, false, NULL); run_close(&indx->alloc_run); + if (err) + goto out; err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len, &indx->bitmap_run, 0, NULL, false, NULL); + if (err) + goto out; + err = ni_remove_attr(ni, ATTR_BITMAP, in->name, in->name_len, false, NULL); run_close(&indx->bitmap_run); + if (err) + goto out; root = indx_get_root(indx, ni, &attr, &mi); if (!root) { -- 2.53.0