Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp254302lqr; Wed, 5 Jun 2024 05:19:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtfpCRs3AhKETU2JWgMxd0aICIg0avSaK+B8ANuA8iJT6lw811ivSXfpB9CHRbnnR/Ipqg+V+jU6VNlCHVf7n06pJ9lF+WtElGUYe0Zg== X-Google-Smtp-Source: AGHT+IEcPortbIaCWcemXy6JlxJRTxz5HApDiyR7aVWSJkBoPy33ykJUaVpGH4H6mLNEmuDxMIAr X-Received: by 2002:a50:875b:0:b0:57a:70fa:8875 with SMTP id 4fb4d7f45d1cf-57a8bcc4aa9mr1694276a12.40.1717589991634; Wed, 05 Jun 2024 05:19:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717589991; cv=pass; d=google.com; s=arc-20160816; b=vfD7cq7oAOlcl0X4PTGDoDj7sYy/CzJ1w3ZsMSwwlK1yIVIg7CplksDi4zz5olooM8 J8gK0F3hUmuc3c5JJSZWvTMAAmqTPwWxWfd+DjrkMC67LMQ/OwT0fDLj2qDUThuds0yw NnqTnITQRI0lp+cWWDPKrfXJX+vlyeP/41FPPHRlrdegYK31XgJc74XyDmjE0qHA/bkt q6V7kOLZjYkMiwnFD7NltHLSn4LJ0uzRZBVNOkE2OXPAzUrayUS6S1od8hqSZJlQRypW 0tsC83a2x7NwIQbzl6a7xfQt3ht2wpWpe6QdtwGosz+8/gG+ipR5qaiZkYy2aMsrag44 FqpQ== 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=n55i08yB5UHf1PDmqFi51FKxiTLE2F/qzKfZwkjlFM82p2Qb2wrT+c/OPJP5TcTTAW XHdAfZ5vYNK6/AnoLutf4LpXVcsNjF3xXBQ+oXgdeSBmr/gjSPZa9oAa+l7/haOZUsD3 3iPE6fA7CbZLEzaRrttWJObprwXFoFEboWNvVgV5Iwne5CkT5jOrAxbvWB8HpkWdLoAE zhSyc+akqayFZUvPCkHU7YMtLfyrwyVHxTNNFeOcqb7e64RIWo9LlTa0eo2L4a9Z6j4F 5/giYTzWDXylZ9xHTyoB7Lgiz4JTNgurCmnypm3QH7tU+mDMjLGJV5zGSCnSb8GXS8YP Oazw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AaZaohYG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202418-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202418-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a9ab83c81si496938a12.550.2024.06.05.05.19.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:19:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202418-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AaZaohYG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202418-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202418-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5BF1E1F215B2 for ; Wed, 5 Jun 2024 12:19:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 223F91990CA; Wed, 5 Jun 2024 11:55:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AaZaohYG" 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 3F98C199A86; Wed, 5 Jun 2024 11:55:46 +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=1717588547; cv=none; b=Tsxk/VuID93DM28HBMCP1hNzKKKu+x202xBB8pO3FoVKqMyuJEoUQMwxjK/8oOLycU+/lUwEtngYUmknHE3ehpkl/49HIbV6AZoDA+E/7KPFj/wpYp3xH/wh9qr9sSdRqZyxyP+oyzfQKUX978ZDU0BKVAQR5BYlzFDI1GDsBgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588547; c=relaxed/simple; bh=qt56nWNkPEyaYkii4ItmJovPVXzjgXTz0F5q9bi3geY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=l3QvOvVQQKFXPHm1YTZu58dX3i+zdXH/OXbE2Kc7/yaXKWJ6LOI6PYAYKPEw0BZxdTXr+7dhFKoSGY6trFxWgYHCV1VRXgBcYJU2pfY3OdhOPosA+TMdNv9j/CA+QEOwTowynbuyXbB1hLimn8SJPHqHKXeihR8pygtfuyY7+jY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AaZaohYG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39F18C3277B; Wed, 5 Jun 2024 11:55:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588546; bh=qt56nWNkPEyaYkii4ItmJovPVXzjgXTz0F5q9bi3geY=; h=From:To:Cc:Subject:Date:From; b=AaZaohYGzM1zpUZYdAfbbQ2OIjXoPbphL0BGpXsOsbyUqc+16TED/c5PdXTgSohjp YKbsP8PByFFx74ZSY7VY6cHMIbrsC8uTeqFf6I1zii+KfpD4e1yJcDn6965WyVGujh zZFVEJlGVcB6DOwMlISdx+Vf/U4XK3yUIXYXrzeUw4Bs90LNsxh8XtkgRz8P9i4zts eMNij0TmZJYbPujBttneloQ/ruX1wemtVJC23bsMygTukk1RSmKHOs4GWXmFTRi999 gcMXRoi5TMqhybxY7RXdUuIjRcX3gWLtzOdy6oM2idk+sP6eNcCM+UPoGFmfs32tGm vvimXyIavkayg== 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.9 1/6] fs/ntfs3: Mark volume as dirty if xattr is broken Date: Wed, 5 Jun 2024 07:55:36 -0400 Message-ID: <20240605115545.2964850-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.9.3 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