Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp260816lqr; Wed, 5 Jun 2024 05:31:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUrxPPWy7HoPXpmDxajaIQlCesZQCk2kas1iYA6W60Qfw1KPTXqkWcZH21IUCGCfCRiC1202YiGmQGLdwT1x+MKpnN7nY2YBLNK1XA7ng== X-Google-Smtp-Source: AGHT+IH9LtSfBhPlyJGOkQR99MDqUxHeAUvrfJqJrJJBfBhklZWmtrvse+/PN1Nw7+jknwjiABJ3 X-Received: by 2002:a17:902:b785:b0:1f6:768c:31f1 with SMTP id d9443c01a7336-1f6a5a094e0mr18950545ad.18.1717590710337; Wed, 05 Jun 2024 05:31:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717590710; cv=pass; d=google.com; s=arc-20160816; b=qZKcflrH+5elVkDhPdJLmT+tDO3k19K0+lNKuHtUPcD16/3x76URHDwP7w9VOwmIRI UDxnlhi0RDjFQ2sGJGe0u7Nx/Sv6xRpUSSIlYwOuFuOWIfnGzZOQkym/HKgh3B4zbWLK 93lLhBF4DNeChw0wyLz0LvwjLPZ86RoC0A5VZHeDYSTKpr1ifkob56V1jyMy9Vn3V2wJ JtoqV6UwWAeUse+hyB3cpyExmf1pLeAfXke2sMPjYQI/ShgrmJTfTlVwEFSpkH455gkZ W7tKDBT7egxtxMF0p9kwj29ZwgwqplnLX0EYZH2eRGb2MCe2oT75qWcwldPtdYoCbE0j JYVw== 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=i9LFI3UUDnMmAPTL93MAfgJB9HipC3rnxNnK9MjjtcU=; fh=IVcZYgopwke+Bc9cmwdOT5yAIhnLPNAsBqE9TuY8J+c=; b=hjUfbKZnFikG4Afy7+EOchIf4CZjqlmZEkAYBLxWOX+IW/NTgZbjvFISzgIqEqnvOm rdVTlvpmVv4rMz76CZFU9O1ezfdCFN7DhJ+oJ3H6SyPU97nWPsdXnlUUKgiRzfkA9Los CvUIt7hEEYJMR2xzOUguHmtHbRkDFNaBdJBcj1ar/NI3J14WjuZwtX9Yz8oE7WHf5jaR chYN68tpUU+TY947MO6Uaf3KqQevW0ZxdK/AwK+VKLuqQWb9WUYgOHC/AoRcRNmu5ema Qts5baQ34Mv5l5FgQ8XkT9AYajK6kI9nEmCdDh3KrmmT8xAg9AdGMTnZIDDJGmk6xclX fhKg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HxhBIwf2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202430-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202430-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f67eea34d9si2758265ad.413.2024.06.05.05.31.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202430-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HxhBIwf2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202430-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202430-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E1BA8285B4E for ; Wed, 5 Jun 2024 12:23:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F24911BD50D; Wed, 5 Jun 2024 11:56:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HxhBIwf2" 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 1BCF51BD4E7; Wed, 5 Jun 2024 11:56:20 +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=1717588581; cv=none; b=KmcczOm7780XLTe5E4uPEomHCT7GKt3O3ogGr2yMqLAgh5Iaof+N3c9QycR4CPPA71uyb84V3BLYmqMgpcj1T0BDm7B4AhKxVlWjzGfYR4XhdmxNJ+Ah5GJOo2MYbF8bBZ6Yy8PqIwKpFdDN7yOCarO0CPbUAjgIOYmNBCSClEU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588581; c=relaxed/simple; bh=ceeJCzGk3tRd6y45nGAz6nA6y/fUYC7C7+ndgPabfS4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XY3KJKhNLF1R5XiPoIxigNSAMI2ZO6l5c2/N6oPx3zDcGOR9lgH4otIbm86CZ9i2iNkVClHDMOd5PJHMUVIsy6WV8x4J9N3drIyW/AwKa3/iZiI8CCgqMIFBaTI8YZLG+RFrqpO0tgiu4edIFAYfpk9drcOT4hSEub1KdDiynY4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HxhBIwf2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EF0FC32786; Wed, 5 Jun 2024 11:56:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588580; bh=ceeJCzGk3tRd6y45nGAz6nA6y/fUYC7C7+ndgPabfS4=; h=From:To:Cc:Subject:Date:From; b=HxhBIwf2Ie+qS69nc5uUBUbnI0LESNbnRHW6sxC2zvUWyjydl6axttB/9IPUMSgDe Uefn4pCTQHd9rTLTJGgCsRhACrzW/1HTaFpNJapRyFhvS989odvF1MGM3HarB+dsPQ 36iNao+2UtrTvQ4HTQgpOvTiU88JHbc5R0myZW+IFd5IMMn0PzM4SGxbKbk6BNieKQ y9te0+j0+N5j6r0luORRsirVfET+PaRHkHfRm8f0QV3Al8hFDpE1dUTR0d1EMtuTcA 7WzIOgfaeS4jLNYfrKUOlAfYJn9k5iL7ALuFjD6MIxKmQ1f5vu6gmsJUsSz2nW1Eh8 3de4zUH/nEeMQ== 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.6 1/4] fs/ntfs3: Mark volume as dirty if xattr is broken Date: Wed, 5 Jun 2024 07:56:13 -0400 Message-ID: <20240605115619.2965224-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.6.32 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 b50010494e6d0..72bceb8cd164b 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