Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1345236ybp; Thu, 17 Oct 2019 11:22:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFGOV3b+/ZhiPStZ8c89N1zV2aop7EVgvOm4VwZ5F5beWc2C/NzMPcPS/hJcHa4pj8P2q3 X-Received: by 2002:a17:906:ce53:: with SMTP id se19mr4767616ejb.17.1571336533784; Thu, 17 Oct 2019 11:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571336533; cv=none; d=google.com; s=arc-20160816; b=NzbOj4B+p4YdZ3189Fn8POeDxaIFiqiH1DMtAHj7VMgYTP2elxpqsPubagQBf/z70b QOcBsB9F4cHi3EYcv7d0noYZnLsXV7gXkkJTG3LIjT7UlCpXnQwtj2ZI63sSntGPmfpV gE2BDp3z8lbtlr5OpNxmwVMNOF3HAzs79Mu8h0mX3TCh8LGlIPz1WSVhvOsxOv0EIZZe 0umZz8UITiCUWpq0g7pI+yefskXGNkcNk/Biix3BnscckH+HGrLLFW1gAEDIOqyYK/fb 7PdfQgc+WvZKgceIB4k1QUcjb/JumsDvXXaJcBiWbW5rjeXcgIMSenqo7swlpVwQC6Jo 5mAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ekcV8BDqjMfpyaeFbp4CKsEF56JxviWDuFWFyR8LWok=; b=lhZZ9d5EY+UNsNJnK/Ytj5EXd/ZfZc0CqiwGdXLpGbc8pUkFjAOavfvnHfSfl49zM6 5L3zhViI87DnMqTVFS1xBdsQ8CJMuvLM02VlWlG7xc1ij+xgkr5+0GeQI6zFsOf3VCsq L/p36SB/inOlqIzX73rKtElRqFeGolHpHcn89nhJfzA0tVxtFhY1s4M2nNuh+EZ7d+pP bV+Jf1I5tZ2pEPLRwrNWEj4a9+LrP441eTSbxrhHfjZrM0r2Clv0zaXnllfKrEO1aVKF 10HNVBgdqv8eyEA4c0uFackOGetow6SzrcJttaXMzp53dVGbQ9WCsU+FkEizTPe44Ysg ElQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="F/XEYvH6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay6si1988624edb.377.2019.10.17.11.21.50; Thu, 17 Oct 2019 11:22:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="F/XEYvH6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438813AbfJPWAd (ORCPT + 99 others); Wed, 16 Oct 2019 18:00:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:54006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438481AbfJPV7V (ORCPT ); Wed, 16 Oct 2019 17:59:21 -0400 Received: from localhost (unknown [192.55.54.58]) (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 842EA218DE; Wed, 16 Oct 2019 21:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263160; bh=rex5Qlu9Yoib8q8n6GxuQ2Md0fpcln747nOg7+/Qw8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F/XEYvH6pO5y9wwM/wjZEnzkdK4vJUI+6k/exuAcC6J2mgVAkn30GquDd3AfUD99S Enf6+nAiwlqyWM34aJQHW5l6bx11VNkQ/2ivjtkijz3sclQVqjcQP+DaPrqQBXfyQ6 3tEQWoZxxQ5wJ6ZwthzjFOVnvrUuu3mrkrfD4Jfc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Josef Bacik , David Sterba Subject: [PATCH 5.3 088/112] btrfs: fix uninitialized ret in ref-verify Date: Wed, 16 Oct 2019 14:51:20 -0700 Message-Id: <20191016214905.242142724@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214844.038848564@linuxfoundation.org> References: <20191016214844.038848564@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josef Bacik commit c5f4987e86f6692fdb12533ea1fc7a7bb98e555a upstream. Coverity caught a case where we could return with a uninitialized value in ret in process_leaf. This is actually pretty likely because we could very easily run into a block group item key and have a garbage value in ret and think there was an errror. Fix this by initializing ret to 0. Reported-by: Colin Ian King Fixes: fd708b81d972 ("Btrfs: add a extent ref verify tool") CC: stable@vger.kernel.org # 4.19+ Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/ref-verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -500,7 +500,7 @@ static int process_leaf(struct btrfs_roo struct btrfs_extent_data_ref *dref; struct btrfs_shared_data_ref *sref; u32 count; - int i = 0, tree_block_level = 0, ret; + int i = 0, tree_block_level = 0, ret = 0; struct btrfs_key key; int nritems = btrfs_header_nritems(leaf);