Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2707052pxv; Sun, 11 Jul 2021 23:21:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYdcfEBWRo5lkgGRSxSGKgsS6HiVDcKRaHrklHPwzCU1Qzq7yRbTGSLg7Ccq4cMNdrquf6 X-Received: by 2002:a50:c907:: with SMTP id o7mr62206850edh.120.1626070864262; Sun, 11 Jul 2021 23:21:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626070864; cv=none; d=google.com; s=arc-20160816; b=Ete5CclahkZ2QRnJ4JBjMnejVlzgcCX/Osf0Zz1YqOJ719/VdEMIHmudmw8miBTJT3 QgWUG+sTh2nwLu3LtfdQLwSOK3jxx3R9ZSHHhHox1cQtUdSRurwLFk5IQVndPyggLBI8 T2rntwWwi+LNU7VRQS/M1Cx7Wvqd/65wb5IOfVZyfd1G2D/40R3pwh2nruU+lIAdiUZF gZCnNLvkcYEjdyXQShk0iQn/h+5+yLmRbZm6xcu6z3QvQu87quKTX8oCQwsIgpWpBX8h 1dIgpgTOazMqYNYdFrPS9i96Nij2z1Rkg1gX7SAoYQXwUAl6/jBpowdRWtceBxkXdORd WCqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iejZ8SHyHkhrdJd0UjAAoR2lmIlxoENRXLxl4Emb8SU=; b=FwZ1GP6TQvxr4KNwMNpnQ3U2dZjyurAuRppku9Hx234J/9HiGAtmzvRdZWJZ8C8IMi TGWBJL7/RsRtFk4lfGJCxyPRpdQpyTOL48//jky5ZEpqq/WYStLAKQFJB0ppOSxjWqwn 3a0ZY0k7UM9zVkWNQVrVmyQ8YjU/50N+2Qd4EM16+J7GDYbLVf1lahDppBUFT+sugfLZ Hk32mDhecr3MJrgSqMoasAgReJVV9c0Ku0auzKMxroe1SzMt5SfJgsulv81mjOgUezJ/ Flq5FE3BV2sSuNNNMLdYYvxuHoPhlFyDkFaB1tgBo8QugQ165NHUBy7Z67dq+3Ef5ryj lS8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lGg8yu3w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si17186998edy.32.2021.07.11.23.20.41; Sun, 11 Jul 2021 23:21:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lGg8yu3w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233440AbhGLGUI (ORCPT + 99 others); Mon, 12 Jul 2021 02:20:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:38602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233857AbhGLGTk (ORCPT ); Mon, 12 Jul 2021 02:19:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BCB89610CA; Mon, 12 Jul 2021 06:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626070611; bh=qsiAY4t92fYxyK2ShFD1irN71w1wdmSKRCjR7NI4uDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lGg8yu3w617A3WmCNcAKvY2jXUyvFS6+Tr0eagjbD9hB6M75SilW7mXvlSX+lrMTm BlNQLug2OdxKDjr1GId72cMxBKskKJS1En77CcDJPHOdFclS1JRPwSP0Kqfzn25u6g 8KXnFxFKaECbaWWVxe2W7niK7abbtDJj/Og5pH8g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yang Yingliang , Theodore Tso Subject: [PATCH 5.4 027/348] ext4: return error code when ext4_fill_flex_info() fails Date: Mon, 12 Jul 2021 08:06:51 +0200 Message-Id: <20210712060704.072972080@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060659.886176320@linuxfoundation.org> References: <20210712060659.886176320@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yang Yingliang commit 8f6840c4fd1e7bd715e403074fb161c1a04cda73 upstream. After commit c89128a00838 ("ext4: handle errors on ext4_commit_super"), 'ret' may be set to 0 before calling ext4_fill_flex_info(), if ext4_fill_flex_info() fails ext4_mount() doesn't return error code, it makes 'root' is null which causes crash in legacy_get_tree(). Fixes: c89128a00838 ("ext4: handle errors on ext4_commit_super") Reported-by: Hulk Robot Cc: # v4.18+ Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20210510111051.55650-1-yangyingliang@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4618,6 +4618,7 @@ no_journal: ext4_msg(sb, KERN_ERR, "unable to initialize " "flex_bg meta info!"); + ret = -ENOMEM; goto failed_mount6; }