Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4523468pxa; Mon, 10 Aug 2020 11:07:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJO6QIKgNbXw8bDy7St6ShRSSB8A4GtmiJevj8gX4IBooOl53DfuPCmQ28Xoisf6S7KEpQ X-Received: by 2002:a05:6402:68b:: with SMTP id f11mr23024331edy.353.1597082849706; Mon, 10 Aug 2020 11:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597082849; cv=none; d=google.com; s=arc-20160816; b=uLT7LF+bT/JwwrOHfKRHC5JkcL3IHl7eMn4NYj3735eqlXrluGKHQNbRGUrhSHXy9w 7BfcLrNYGepvkhsqv7s9Oo5RhwZ2Xlhek5CPKurYU3xJh0J0rb5TYwBjxMInkJW4NijV mdS+SeFXKjtgxqOspsaH831h8LNpuysQ0i93Z9nvsNKMTouLTsfZIm0wvfUSz9HiNZS5 3m5CyIUMygbKDkfDdbNdAg/gYfh6JJNL0JB0uxB5T7T9AX8HpvroyCNw/urcl2FHGpTr xqkwUxSe0P09yYDNeHehQx+0358jE0vtrf4zRNmv0fuAclXmVbJnz41eSDfvzBB8IESo c+Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=CPDhAJBysGA/otfVR4sqocxP5U/lK+/44dtrWKJKWFE=; b=JRaY7QwSzPm/JI2K/GjqHot3aUqgyXa7tUIJYepgSXQDVQTC0TKO18N6+l4fRkhD1t AZ/tE4b94b2g81rUiEbqxHM1f/WMkqgGB9TcUSI+zeJDpWvhVsCPdu6KIRqGgG5MYp7n yv9vY7ebAGgK1WCcO9eDSIa1pq9GntjVQR5/WlyIlJAn2xKTCR8oXQjCyzOkdUeJBSLs Xag221yfcKnij3FQb9lbqVX6dCnt0DogMxzJXFc2pyv823+ZtTo+7frz4+XM0x7vrZrM yI8heBMGwLRNsJIYgs1U8nYuEci5q65ROhFfTEO+CUYb7AAYtVy97EckUgYNWBBh8yUw rJAA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o23si11403619ejm.311.2020.08.10.11.07.06; Mon, 10 Aug 2020 11:07:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727982AbgHJSGM (ORCPT + 99 others); Mon, 10 Aug 2020 14:06:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:50828 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727003AbgHJSGM (ORCPT ); Mon, 10 Aug 2020 14:06:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7B4E2AC8B; Mon, 10 Aug 2020 18:06:30 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 0FD08DA7D5; Mon, 10 Aug 2020 20:05:08 +0200 (CEST) Date: Mon, 10 Aug 2020 20:05:08 +0200 From: David Sterba To: Greg Kroah-Hartman Cc: Pavel Machek , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Yoon Jungyeon , Nikolay Borisov , Qu Wenruo , David Sterba , Sasha Levin Subject: Re: [PATCH 4.19 09/56] btrfs: inode: Verify inode mode to avoid NULL pointer dereference Message-ID: <20200810180508.GG2026@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Greg Kroah-Hartman , Pavel Machek , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Yoon Jungyeon , Nikolay Borisov , Qu Wenruo , David Sterba , Sasha Levin References: <20200803121850.306734207@linuxfoundation.org> <20200803121850.766021165@linuxfoundation.org> <20200804071132.d6awebnvt7gnqfkb@duo.ucw.cz> <20200804071836.GA1416416@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200804071836.GA1416416@kroah.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 04, 2020 at 09:18:36AM +0200, Greg Kroah-Hartman wrote: > On Tue, Aug 04, 2020 at 09:11:32AM +0200, Pavel Machek wrote: > > Hi! > > > > > > > @@ -6993,6 +7010,14 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, > > > extent_start = found_key.offset; > > > if (found_type == BTRFS_FILE_EXTENT_REG || > > > found_type == BTRFS_FILE_EXTENT_PREALLOC) { > > > + /* Only regular file could have regular/prealloc extent */ > > > + if (!S_ISREG(inode->vfs_inode.i_mode)) { > > > + ret = -EUCLEAN; > > > + btrfs_crit(fs_info, > > > + "regular/prealloc extent found for non-regular inode %llu", > > > + btrfs_ino(inode)); > > > + goto out; > > > + } > > > > This sets ret, but function returns err. Fix was already submitted. > > What is the git commit id of that fix? The fixup hasn't been merged yet, I'll send a pull request in a few days so it should be in 5.9-rc1. There's one more fixup of the stable candidate patch, 9f7fec0ba891 ("Btrfs: fix selftests failure due to uninitialized i_mode in test inodes"), so it would make most sense to take all three patches at once.