Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp256877lqr; Wed, 5 Jun 2024 05:24:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWa/m8FKzKjdzOaeX9zqqDVz6lDhAPsR2jHT6HqCA/v8xSikkjcfP15wmKhEANhk6sUYAZ6+JFLZX4U/fKi5CHKUarb9OQoUnEhkbCbyQ== X-Google-Smtp-Source: AGHT+IH82fqdA4b8wUrs2wGZBAsc2hwjqhPsBJC4w6sNoxxYsqqAJa/QMwZZccI212S9BdNbJ5zu X-Received: by 2002:a50:9552:0:b0:57a:23eb:13b3 with SMTP id 4fb4d7f45d1cf-57a8b6a82a5mr1613406a12.12.1717590280415; Wed, 05 Jun 2024 05:24:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717590280; cv=pass; d=google.com; s=arc-20160816; b=Nlx6IjS3GyKDphgAfwX4afxhpETaAMUfwgYIzFR9dwyI8UNJYsNJaY5oTjACa+FCQP Zrf8RLZSNCnDFrej2HKHYjJr2oxi+C2viIfbmJ3AiF5aY7eVEn6ko7o5ZHqRxb+BdY6V K52g4IdxMIavGr6slYbvWIWAgKvNis+AhWOlpQQPmkmPrycUpSmQVrA7Kv5H5kGd/sQX ZpLqHYhnPU9l5/9LFymvpOat7KBcxSsAPksJLiA7NDwL+OGK575eixtQCO1Zv/vAMlfG LV4Q56/p+4B8A8qA8lVto5U9ok7m5rcV9bkY/52jtkjoR032IylXYIi9Gx1S7sZEksE9 RDZA== 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=B279EPrgAYf2lBuey9PxU7oQko+IV/AnDikJzPx+h+0=; fh=IVcZYgopwke+Bc9cmwdOT5yAIhnLPNAsBqE9TuY8J+c=; b=J+1xHQ5oF9E7a6xeSuznLJZ5HbxI3yQIMdpj9mwxoHjb9GGi03mmEbeZ9W+n15CU17 UjFD0aa85eUKlXnMqy7Oc8gAS/OUUrfcr4pIa9waBQEXJ/GymDCywGXcfjeHyCDrOJQN unIPbP29FPlfBDTsdDHp8GTxsPHDHxPiqafjHToR7nkA6I+64bk5Khws5nxsgx9JjugT MB7bp4NjwAL56OlLeWPNd/rjmksg06GxCLpSFCXhYcK21D7/4yfQFpeqS7gOCwbvJzHq mlYw/clfmHoURN0mWD9CbncWqczy2L2e+BQ9dAI53oXLiGb6pKdjvtA5I0+OAnv7Al0V XSBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ssRx4W/z"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202436-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-57a31c62ee4si6206811a12.212.2024.06.05.05.24.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:24:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202436-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="ssRx4W/z"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202436-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 223121F24F75 for ; Wed, 5 Jun 2024 12:24:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 406AE19AD99; Wed, 5 Jun 2024 11:56:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ssRx4W/z" 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 61CF21BE23B; Wed, 5 Jun 2024 11:56:33 +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=1717588593; cv=none; b=qL6QSe4iYvc7kON664YSshPdXjAGBLIVwrhBenIAt1Xg0ODARDQwXFxP9GybqLLMANjnYUIIg3TWfyCOf0Sn05pAkItJ25kjSJzVDr+IPd2OB5e/fQ5HMJhfPVC3V4/A4J6W7f/dMJ/Ct+RBqrNCW+axjc1a3eE/e7d/ET2gkJc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588593; c=relaxed/simple; bh=ud0KgdxXFmBBJ+h+D1lJUODrVBGzmuTQU7s8hDu5FGQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gwGrMdo6IOx15+T27IAfKdvL2AiQC4sZe83/ucWX2BYeJtSkVQX8MxTzCNN0Oe+V4Y3DYizbn6DyKJcGdG0vEKSKahtRJfqyT2AMeUxpSgULzx73rCKU8q3NWWWETuYMgxCTnu7RXu3rz79EyPkhBtub5IayJaJ0k4PnUXs6nyU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ssRx4W/z; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FBB2C32781; Wed, 5 Jun 2024 11:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588593; bh=ud0KgdxXFmBBJ+h+D1lJUODrVBGzmuTQU7s8hDu5FGQ=; h=From:To:Cc:Subject:Date:From; b=ssRx4W/z7w6DT/WG44/1PefD11AjmXyxKc40+7gDojqE2HV+QeogvIMFlITBLidFl oaR6BeVuxniOJ5smBDsjF1slfChZy2uquEWqi2Amj0NoJNpxIirTwOD4k8daxDu92Q +JlMU1Vb/CkVRUjY70mZM2FJjt5ASKQ9DvT69e3wzz+U7vdi9kJETQm/QvUIcE+qcA 6ksgLqb2/h1ZX3jTm6eTbmOv7rYlkvjgV3A3C4chutNj2zWT52LQw6Jz5ziWJMNOi3 UmAjj1uE+UFrfhoO8CNOv4PdhbYm0upoKb81R4EIe78Xoe2/vaV5WoLWnXNmQ+Al5a 4qmSNE6GulLxw== 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.1 1/3] fs/ntfs3: Mark volume as dirty if xattr is broken Date: Wed, 5 Jun 2024 07:56:26 -0400 Message-ID: <20240605115631.2965331-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.1.92 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 d98cf7b382bcc..2e4eea854bda5 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -217,8 +217,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