Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4299107pxu; Tue, 1 Dec 2020 01:13:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZJkGW1FsmN/20P0RV+svplX1EztmUlIbx7ef54+/ij/E8bHZ2jup6gaDvxHsPGMKQdyxT X-Received: by 2002:a50:9eae:: with SMTP id a43mr1935997edf.109.1606813987511; Tue, 01 Dec 2020 01:13:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606813987; cv=none; d=google.com; s=arc-20160816; b=MPFJ61FXDjjQlRbTcUlinhfOvq2yRB4ZKRDgWB+brNgtpuUWp9x/fwWDbkLc++axfP qZGR8Ojw9h5b9/8sGsYjQ8PwLoe5dmA2gdVjYua5wpGVaDjkJ0qqiFdlRMAyJdOrf23N Ihx9w5SGEtdXT6HIFb3Yfk5zJz9wTqKR4B8Ic/8k17Pailq7v9xsKefTXsvPkFB9Lx/S uY7lcgLAJca7F71ZP0D57iL49huPddGf8/mHsfLrP0W1hBgeffYhgV2ChddtEfv/G8i0 3YxCJ/kpLgapxMQeczVa+2aCZUtmAMQ4EAI4vOAyq8GZ1VVq1x+w1Btqj4nmWVQ8lbVD E7vA== 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=78vA4poFivl7pYY3YwoDhrJufYMO+IrIvC3YZgbZYuM=; b=kdFCiPiapAaVegeUirijOudO8/3txiHg3luS+MJ4WITueqJcUpToGxmHqs2BLFWO5r nICjBxUzGi9R+eqfBSIwxZZWjGwSW1QCbtkEFt9h5EQighVwXyhGu8B5yHaSv1QB8eHR oCbtkL5T+2HSORdLVs52D9HVsnrdDlwb70pot3t6s34J9OffDDFsJwnLI9P3DuXgGImL mf1ujCb4i7GW2jjtsIwbCMEzMd1tH+w485n52+gZLjOAj9iMZtVyoL2PX6Gu6rsNy59u QgeIWHz9NRwGq2jn7/dYkrZ7tB1CFtDzXsJveyuVw0DwlFVvzsz17Jqf2Qkpukp/6j6D 360w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0IcRsFJa; 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 f22si713427edx.520.2020.12.01.01.12.44; Tue, 01 Dec 2020 01:13:07 -0800 (PST) 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=0IcRsFJa; 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 S2389496AbgLAJJc (ORCPT + 99 others); Tue, 1 Dec 2020 04:09:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:45546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388707AbgLAJI1 (ORCPT ); Tue, 1 Dec 2020 04:08:27 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C3B44206D8; Tue, 1 Dec 2020 09:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813661; bh=WAKkIpnNYr7K13+/8LHyWc2hmcnU22KXzsMNVU78RRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0IcRsFJak/kT6tw25PmmFmEmFLa4mLsZJ8qUr1TvYPQXaSfIqQrzdsqSN84+rT7/Q qeHAOptf+te87s5MbriuAdXt7kV9iLZJVMH63/xgioToGZHbURKPz+jgQf5g3104Dt IyBXUTDkubLRvIKolibLK3/cjnjn5NwtmCw3LHr4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qu Wenruo , Daniel Xu , David Sterba Subject: [PATCH 5.9 009/152] btrfs: tree-checker: add missing return after error in root_item Date: Tue, 1 Dec 2020 09:52:04 +0100 Message-Id: <20201201084713.054184135@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@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: Daniel Xu commit 1a49a97df657c63a4e8ffcd1ea9b6ed95581789b upstream. There's a missing return statement after an error is found in the root_item, this can cause further problems when a crafted image triggers the error. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=210181 Fixes: 259ee7754b67 ("btrfs: tree-checker: Add ROOT_ITEM check") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Qu Wenruo Signed-off-by: Daniel Xu Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/tree-checker.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/btrfs/tree-checker.c +++ b/fs/btrfs/tree-checker.c @@ -1068,6 +1068,7 @@ static int check_root_item(struct extent "invalid root item size, have %u expect %zu or %u", btrfs_item_size_nr(leaf, slot), sizeof(ri), btrfs_legacy_root_item_size()); + return -EUCLEAN; } /*