Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp994176lqt; Fri, 7 Jun 2024 05:17:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8O+3/6VgiwMGmjQ3SBcjM8591RqpDTXNry6eEZsG18GnXane/oHvznowyUjF7EusleUWLxsQyxNvF9nVT7NT6un6iKFANmJ0kP3BaYg== X-Google-Smtp-Source: AGHT+IGmUfmGyTC1vh3POD6oeUoX76pSLMgOOabqPym7Aj/XsK3frpzJ9ONXbFnAJL5szPbO9fMB X-Received: by 2002:a05:620a:5e14:b0:795:38ec:b0a6 with SMTP id af79cd13be357-7953c5c908cmr220216785a.68.1717762670025; Fri, 07 Jun 2024 05:17:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717762670; cv=pass; d=google.com; s=arc-20160816; b=O7SxB9RwRB0YEwgyPGLxURbIXTjZ8w0W9ZhYU9fBMkg7MfCGuIZcyGfd1jIoPxaA5p kcJFlnrvIAJBKMH69JjbrQB8BfwE7l5GAgKLBooBXE1x2iPl8NPet7Do8bv92dCuwv8s o9coaC2twu64pkYFWfbKOnm4Aed8i/Tb/T792EKAXKk8t8qpLy16HEatFJQMNgOPkR1e UGu1PPm9E/H/Qv+TqmRh9WJOk4C8h0lJxLPecq4Uxw2ASW19FUmbQ5Mg1k8t2KkIN0LD xtsYACQA7nb+Q0/uXWU1RuXVx/CEt/qaTSVkgF13786TQfBsoaPNE5dfNxhcUmDtqAgf 8rVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=8u+Q76oxJF1clofIfbRfsd1y6ovFf5s500dJZxmChZs=; fh=xoZo938iZo6Zo9BQRi1y1Y/2pdszedQYQQiMhZQzvOk=; b=reBXRboCFf0wAMFy/CIMYNM4CiTUqBbTuCHsZgHrgbSPtq2likYKa0A5ySZi0XW1Zx LscvKRCo9rdR0gWt29ReoQsuHmnvY9tTQTHCmFxYE3vXOmiUG7ytDY3F5uOarsZjzVUc +IbLAg6cCprMnRb8LROX0yBsBkOTJZHiL+e9eFq7u9Cy0MS3nTNr+crTNsaOr7EM7G50 gpmdTMOqbBInd5i6kq0mdbesfRMekzlK8yzOFqgCNAsiP3uGe7FNjH3mGK14HIYYLkxS L16OXlrxoOS2WNy5k9jT2Zp06rQ3radr0y1AZGSf0g1Acj/OtJiwSiaQzddq5FTFVzA1 VKFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=q6xixpP0; arc=pass (i=1 spf=pass spfdomain=paragon-software.com dkim=pass dkdomain=paragon-software.com dmarc=pass fromdomain=paragon-software.com); spf=pass (google.com: domain of linux-kernel+bounces-205998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205998-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-795385e6c51si280727985a.580.2024.06.07.05.17.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 05:17:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=q6xixpP0; arc=pass (i=1 spf=pass spfdomain=paragon-software.com dkim=pass dkdomain=paragon-software.com dmarc=pass fromdomain=paragon-software.com); spf=pass (google.com: domain of linux-kernel+bounces-205998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205998-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 728611C23830 for ; Fri, 7 Jun 2024 12:17:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DF00190685; Fri, 7 Jun 2024 12:16:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=paragon-software.com header.i=@paragon-software.com header.b="q6xixpP0" 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 CAC00193096; Fri, 7 Jun 2024 12:16:18 +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=1717762580; cv=none; b=t7uSqy59I0UcMMkkINsONGf9erbgNKfjB1UWBb6RS/qAuyaDMynwCB/fWX8lKMI/VCRLyvfPO+QWX0ecF1NiGnvbmnLgUSVT+ZAwWnAPO7syHxOowlPVKPX3I3ekR9L+U8+g0UfSFiBaDrvvHRXUT5lOXqeqAlr89P9FIO3h+TM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717762580; c=relaxed/simple; bh=3Gx4jk1cpfnv09caCY1DKsrrDbFLhjDAp6lh7M4ByCQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GX4WZPlJvg/LjRNY+E4cJyaewlHIkehJMLCTJivfmFteS+6iIM5/zMdVHflR2C8SXM28dUfHGApf58gUCQfRHGeNS3sl8pDJ8WQ7wiGhjqz/r5ur/PhADzPdD+SBhlYn59mdpCJ6VCHaKdesi9Ko+WB5vKauSgvrV/pL2KK6Sas= 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=q6xixpP0; 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 Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id EDD012113; Fri, 7 Jun 2024 12:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1717762103; bh=8u+Q76oxJF1clofIfbRfsd1y6ovFf5s500dJZxmChZs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=q6xixpP0SdxNTM4bdbMIfI8YdQwKzY7DaELnEp2Bjt81IaQgemLNsojm5BVDn8Gdq iUxZgfE04IUbfrwMWgHpNOzs0IuMaFXYQlbG5vcGRwkO26Av8XD2CrXuPBbdTLRawg zoMGgwbGadvLrnmAZDFIHILlWn1iSbVVlxUpL6ag= Received: from ntfs3vm.paragon-software.com (192.168.211.95) 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; Fri, 7 Jun 2024 15:16:16 +0300 From: Konstantin Komarov To: CC: , , Konstantin Komarov Subject: [PATCH 10/18] fs/ntfs3: One more reason to mark inode bad Date: Fri, 7 Jun 2024 15:15:40 +0300 Message-ID: <20240607121548.18818-11-almaz.alexandrovich@paragon-software.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607121548.18818-1-almaz.alexandrovich@paragon-software.com> References: <20240607121548.18818-1-almaz.alexandrovich@paragon-software.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) In addition to returning an error, mark the node as bad. Signed-off-by: Konstantin Komarov --- fs/ntfs3/frecord.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index 0008670939a4..660a7cfba8f6 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -1601,8 +1601,10 @@ int ni_delete_all(struct ntfs_inode *ni) asize = le32_to_cpu(attr->size); roff = le16_to_cpu(attr->nres.run_off); - if (roff > asize) + if (roff > asize) { + _ntfs_bad_inode(&ni->vfs_inode); return -EINVAL; + } /* run==1 means unpack and deallocate. */ run_unpack_ex(RUN_DEALLOCATE, sbi, ni->mi.rno, svcn, evcn, svcn, -- 2.34.1