Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp262024lqr; Wed, 5 Jun 2024 05:33:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1YP//4BrfJyeRXzYk77wJFrZzarMbgHT9xUAb3VHWlokL5fLUUUcN3SNxRAM28XqUgNFnsLgqR/jmXZwJiZHyRQ3iAVbbi3lm2KtMIw== X-Google-Smtp-Source: AGHT+IGNdg7fsmPI7cep+yS57VSF8KYMkqVBEC9PEYOjzFkgKed17zlZrfqWX1aCQnUUb48UQpwu X-Received: by 2002:a05:6358:88b:b0:19c:1b45:6bb5 with SMTP id e5c5f4694b2df-19c6c9f3cf6mr257779055d.26.1717590835227; Wed, 05 Jun 2024 05:33:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717590835; cv=pass; d=google.com; s=arc-20160816; b=OHkuYG8ZBMAPzkOjoLgq7Lyk/h/TVKPaKFYncwEvgZQ/O4iOqtg22ByrEG9Zh7vVdE fVFIbuJpnltSsjNGh6sVnYycNk5+Ttcw3dPr/2lOxfQ2Q/Klo26K3Jcz+5LDiDC/ruJG 8YQB60ZYrKPSXFMG4PlzT2Fj/RjT/G4A4aw9W332GK2Bl7AIT/unpD15Pj7ZKQsdk1Mf 0BDUWbSJgeUH+8QhRzPg+El/I9So5pQElrE6zoIvhxDa2Q02PTp5bE53ze+4OnaXC3W2 B6UmvNm58TFgKaU5GRBPqyJGAHnnHXWstF6D0Ao4L8k0fDG3eRbMcCmcoE3nzq4lgkg9 mwlw== 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=FRvl37VbeImUmZQu4uICZyRtLrNJoVE26etY1nhwFQA=; fh=IVcZYgopwke+Bc9cmwdOT5yAIhnLPNAsBqE9TuY8J+c=; b=aYBc7OfZIQ3H79P/GT20rStl6QoIkqvQe6MCHbesVnyzm1XQcKxP7T2ABIIV4MTu8u iUdyKZi2xvVTR4pLJTsRyC3aETzT/4CzgRHS3WG9If+Q18gIppZblzYKe++wFkUu68XS GJ49tgOL2/ToOAk1WYrVOkB0sli77oZGSI81P9INmJgd15G0tnqHm2Bt6TboTbQEatB/ EhYAkhcMI5mPoJMCyzrK923D6YBbBQ+DdfKsgP0kdtuRJPSDtoNb7ujOqVboZrx/dK/6 DDTarn/Jfuf9CzS4r07V/KZnHzBFZu2iP0n+OmzrsXCIiqnZkJDJx+SxhHbHaCUwJCrt y0Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h1gafLws; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202439-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202439-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 41be03b00d2f7-6c936f8e794si3525744a12.464.2024.06.05.05.33.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:33:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202439-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=h1gafLws; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202439-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202439-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 B41172838E6 for ; Wed, 5 Jun 2024 12:25:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38AD019B3CB; Wed, 5 Jun 2024 11:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="h1gafLws" 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 3470319ADA7; Wed, 5 Jun 2024 11:56:44 +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=1717588604; cv=none; b=NjYRNvmT+mElsM/rqtCGmoQQY5MxuYD45YdVqEsDAp+AbVRfouivspZ/d1V6qRymFcQdH0uCW2pnG4Z5SKJJlT8L8c/iVKNnf9gBVhnGo1QKJtaZ5cPi1ZkiYTgM+DiOtzyprzhI3j58Dsn51+6RcbPc3ciNP6lMFPR9MR5mWMU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588604; c=relaxed/simple; bh=uQIkL1E/HHY6EpoCtNAJE0d56wVqsrIf/eWT7Jo3cpE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YdgiBGL3hWEqNbAJpgKovAi4NqzADHwNgs5o+VaTXmxWxSFPlTvT++FPrBvMFRLOSz5dHwBSxYqb2JQqrnpNQFH01gcXJLsCijv2YlbM6rqfahy4iQG+zr2eQ6R5cJVKGpVCdeAfv1hJrmZL7qw4HiSkc2g7rPPXJhFZcuVwIRs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h1gafLws; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 734FDC3277B; Wed, 5 Jun 2024 11:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588604; bh=uQIkL1E/HHY6EpoCtNAJE0d56wVqsrIf/eWT7Jo3cpE=; h=From:To:Cc:Subject:Date:From; b=h1gafLwslIyjAexC+1OCk4y+K+G6lwaWaPaU6t1acKyWhT6z+pSoyOPddHdSwlEnM lPrjKFUACEqIG5xJrY3cMBSNz+Rs2zlauta6Hs+zIDzaoiEmBm8TRMQS3M0GHHiwO/ GseosHiPJRvucdZy9eootScKVJ9CQcsFgI0IuLR9eUHOkELrixO4Qad53xQmRJB4LL ooa0i3a/Sz37p6b5EJyhPLQ+WoJoDTaM9KrkjVp4+kWxjGXFRjYBJ6WGCvL/6+9Oro c4vSKYdg89wLucFed5Xo11ITP85FuHpGtBJz0PW7OEepCqkSXyb9b+Y11FAIKIZlsm XaNw76NqLtHmw== 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 5.15 1/2] fs/ntfs3: Mark volume as dirty if xattr is broken Date: Wed, 5 Jun 2024 07:56:38 -0400 Message-ID: <20240605115642.2965408-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 5.15.160 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 d0b75d7f58a7b..4a7753384b0e9 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