From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) (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 51DEA2737F6 for ; Mon, 29 Dec 2025 09:29:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767000602; cv=none; b=G1ToAHz0iy0TidjCofjZFkn/FZgouL0AsvPzYG5D0seAMVO1DOaWE6NyPKrYetN6HOhzc4wXhvuxOfa1uS3NFKoF7l9247dl32V+7howIieKc0CqNDIL4QMCI1C2/YcaoHZy1/8vo6iVUmxHKhVM2+U9pbG22AA5NWJH/M/kRbY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767000602; c=relaxed/simple; bh=AJfDOPfP1rzVILWL2pRQCw+ngkK0bGo93ugM9RB5T7s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iZcFhJQE+RJcPFAosjwbBkGXbL3x7JZP4H1LFf4MbRoqey58dGzzqtiFSXrBxRw46YvNAkxf1cAkxTi7ORnRzYi4JtcP/sgQOlfhAh5doXb0SFvf7/Y2wsj8ndejjTuyfVGViAeTvHUlvIQzRZVfBz3TsMAbj29m/Ho5slO/t0o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=bPC7elCn; arc=none smtp.client-ip=115.124.30.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="bPC7elCn" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1767000595; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=3rk3kvZ3VXsGykVHI9qGaamUdteLgjuNOIN3NRqV4B4=; b=bPC7elCngaQ7PH9baDK1gg0wbSojr4u+fTVVWKGRkaBAa/cZCyfMxV2JZe6qHfBxA7EF9HJOoQFcLK0rOtTDM9QuL3iUsxKyxJLgqc7p+44g2UkSzGSmcMgGMQYQOqIKXyurhyOn1aBUS8DxcrCGXKJBMfln4iAHEhAAnEJvmJ8= Received: from x31i01179.sqa.na131.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Wvqzdsd_1767000593 cluster:ay36) by smtp.aliyun-inc.com; Mon, 29 Dec 2025 17:29:54 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org Cc: LKML , Gao Xiang Subject: [PATCH 2/4] erofs: fix incorrect early exits in volume label handling Date: Mon, 29 Dec 2025 17:29:47 +0800 Message-ID: <20251229092949.2316075-2-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20251229092949.2316075-1-hsiangkao@linux.alibaba.com> References: <20251229092949.2316075-1-hsiangkao@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Crafted EROFS images containing valid volume labels can trigger incorrect early returns, leading to folio reference leaks. However, this does not cause system crashes or other severe issues. Fixes: 1cf12c717741 ("erofs: Add support for FS_IOC_GETFSLABEL") Signed-off-by: Gao Xiang --- fs/erofs/super.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 2e4d0ea2ffa1..0d4f736ae1f1 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -347,8 +347,10 @@ static int erofs_read_superblock(struct super_block *sb) if (dsb->volume_name[0]) { sbi->volume_name = kstrndup(dsb->volume_name, sizeof(dsb->volume_name), GFP_KERNEL); - if (!sbi->volume_name) - return -ENOMEM; + if (!sbi->volume_name) { + ret = -ENOMEM; + goto out; + } } /* parse on-disk compression configurations */ -- 2.43.5