Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp264968lqr; Wed, 5 Jun 2024 05:39:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUDh+wrOUMXgHDdMofNXniXBTZejZbOKikIInaCxxQ8J29lpWKW9fw3/4YR1pYWVSuilKoP8a1WH+qClGexYcRnncJytaTwQufzUB+dg== X-Google-Smtp-Source: AGHT+IGs/Ampg3+1+SIXYvhfzKFsBbOdRGeTAtOeMFTvHB0h+ocnlv27WEJRorWSsrCR9cFifkjI X-Received: by 2002:a05:6a20:f392:b0:1b1:c745:5c6c with SMTP id adf61e73a8af0-1b2b71c8ed4mr2330615637.62.1717591160800; Wed, 05 Jun 2024 05:39:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717591160; cv=pass; d=google.com; s=arc-20160816; b=yoK4PZHJBGGc9Tm9bgxBNPfoPmnUH4Cw7vfwR2e42KBIfGfyXSLX+Wb/AbMlgBE0Hl 2fSDbkerYr39UEbK2yzQl5xICZv8zETN4xq26nvi39haz8DB50Cify+K9HRuwfmW/dBT pTs32w3ScO7Xa/gbRH2x8K1BBT+mAXbkxK0T+Ttb8rKcfCN5pROWs2O4nxU5IM6aylKp WAwmdl6ZTFwECry1rx/nWFm2qXa5EaOl/cYFHn0D/bX7SmsKs1UvNdJ9A2OYwadp7MG6 c8jtE2Q4qoBr0R4qRXxnHq3cFxeyapimyYzxq3DrG2yxhTFet9Bwg/WY3ev4WE1EvSFl 73xg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=GtrxlMSJZxKHSqC/bNbhUOdj/Al5w1A8ptzEsSRHHH4=; fh=IVcZYgopwke+Bc9cmwdOT5yAIhnLPNAsBqE9TuY8J+c=; b=MeZzHFjA7GlYxPB+56vOOkphrksWmLt5yWENrcsiXXtDm/xqnI/GnVpBapOdWy0tmk YDzMHqlwU19GLtjyUlb+jsiG2YWDsUaCuHY05osNMLjyUupxCqcj/zucJock86CRDjR1 eRtLsDICjWEAU+xdTxZPTtOWZHsgfPCiirM9H50nxuCi+DK0KLiLXSQEtEgkgOPkwiof Fk3pq9FL5L4iO8q6wO/JOTZGIGt9WaWjUH5vZ3OjwUtXLWT0wTdqwKGH+ebWpJyPIy0z KMkL37XTlo7OkLddeH6an8s6PbbrE0zx0tIn9FeqAaonwvf2NaamJrHpHy4R35nWBsDw qtAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HqpozGjA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c359e09dd8si2745257a12.381.2024.06.05.05.39.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:39:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HqpozGjA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E12E5B26F9E for ; Wed, 5 Jun 2024 12:21:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 124D01BC076; Wed, 5 Jun 2024 11:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HqpozGjA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 386C31BC06B; Wed, 5 Jun 2024 11:56:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588564; cv=none; b=n32115CyNNQ/O2IX8Pf9Y8YiNfQDK3Zji9nGatt7gNQPvcgSLVoVb/XvhOqP+p2W6X59lleiZG1JNLYbj336aCQPZSv1E8LU7zAsKS7bsyKbP8htk+1Pi/mYaMPtBoZpIelEWakm4ExqjYdw1PAXaigL7WFSFg1/IZmIA4cbjXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588564; c=relaxed/simple; bh=qt56nWNkPEyaYkii4ItmJovPVXzjgXTz0F5q9bi3geY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WwSXb+efIylMDdhLl+wlwVL4SrBn9ATRFj6V5O4r2HQtq7S3AuUjLEuc5jT7PQQa3MTd7alOJP5Or14T0YFAenOJIW10IKOnnmGYjAezolU061SkuQs2X3eis4DdRSn51lyQ7sotf/k7a/Y84QQTXmblG6USIjq3iUzpO1k5zqg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HqpozGjA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C73EC3277B; Wed, 5 Jun 2024 11:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588564; bh=qt56nWNkPEyaYkii4ItmJovPVXzjgXTz0F5q9bi3geY=; h=From:To:Cc:Subject:Date:From; b=HqpozGjAJ13JSM8pfIMvcafgGEAfIJ2KuyX/MrrS+DOM+07iUwbNM6H1g3kYj8389 +gvI4gtATC0UldigBfecaArsFmar4D0f9aOzm1+DxsS3FpMdcOi+kfDr6XUK0nEqNy sJbVYEXwjaoaCAVF/05Eqr9/sV8Z8zkKV4jYsof1l8pryGWXoVpzWKsZzdVAm8O2YD kAweh8C+oUnrEkYUUvgH24R9Ko5W917Sa+zzite/9QP+LxHujegjqNYikcO6LfLx3q TAMuCnhqodU9q+m2aSeDmU3eu8G3L87H7rqRqCix51ojFypqhmg1uV7eMwfG7gvf4w wqWiErphBUyMQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Konstantin Komarov , Sasha Levin , ntfs3@lists.linux.dev Subject: [PATCH AUTOSEL 6.8 1/6] fs/ntfs3: Mark volume as dirty if xattr is broken Date: Wed, 5 Jun 2024 07:55:53 -0400 Message-ID: <20240605115602.2964993-1-sashal@kernel.org> 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 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.12 Content-Transfer-Encoding: 8bit From: Konstantin Komarov [ Upstream commit 24f6f5020b0b2c89c2cba5ec224547be95f753ee ] Mark a volume as corrupted if the name length exceeds the space occupied by ea. Signed-off-by: Konstantin Komarov Signed-off-by: Sasha Levin --- fs/ntfs3/xattr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index 53e7d1fa036aa..73785dece7a7f 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -219,8 +219,11 @@ static ssize_t ntfs_list_ea(struct ntfs_inode *ni, char *buffer, if (!ea->name_len) break; - if (ea->name_len > ea_size) + if (ea->name_len > ea_size) { + ntfs_set_state(ni->mi.sbi, NTFS_DIRTY_ERROR); + err = -EINVAL; /* corrupted fs */ break; + } if (buffer) { /* Check if we can use field ea->name */ -- 2.43.0