Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp103204pxa; Tue, 4 Aug 2020 00:21:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuNyjWbMOE6ljuK5YkDP4uLEaxDpZQeLB4Pl7si6JrIveMclHK3lm3NFo/uf0prbH9cT2K X-Received: by 2002:aa7:cd76:: with SMTP id ca22mr18749801edb.42.1596525690429; Tue, 04 Aug 2020 00:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596525690; cv=none; d=google.com; s=arc-20160816; b=I7sWoeODpvr9KkPp71L1eyMZ78+yGYCVE3i3bsck8rzu7mgru0m3SLeOy+NVdcV2dL bTV3gjHe22UBRQdjxgqpqqBjZJFzeXC7k4GE0SILcl6JsJZ+utu0+x3oMV2UoplgPQpy R3UIh3cQxAk2b7oeKvRw1/JRmApjwea2Dbt/QXN58pL4Mi/ISn+3M71M0desd8x2P62w FflGU1oAP6PVLowahKoAVkRgDiV3aSfPaeNRn8M9i8SBH/zaA93x1Ab3WD7E7MlVj0dN oeCBjXTqQE0REmbDG991tMZOVoA25XLL3P/eyqr5pmFTdVkDtXr7AGwCVDuML15SlpP+ +dwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=APfwPZMwzNkJdugBOCS9v8Q5uop+4IOd0xkenLEwRCw=; b=gtbCkYyBa6ZGtZb30rSgsBdTW2Az6K7m7pD75vySOCGeSvTUPHrUQuvAtiCk9RiBUs DWmrRUoAc9+dWcXWVRUD8zCJspCWEPXNrGfoltY5A7q7a0OJpqVCSTK16YpDTE2Hfdr+ dg+fw6NL6ZrE+UA6A1b0UW8h7FhdK37Ijm65aWxKdLSJ71qhgtem/0dln1mc98aocUZL 3y/Fcq1a78zV6Di4csdQ5iozzk74aPfExOsRKeIXxD0K9dIqK5fJp6svGHVXmuz5RFq8 lG9AMo0qDdQup/JiOiD9Y7qpydQXWPKLDvv4O0Qs1VVRkYtL/FHdh67eu618M6PaOdPx oKRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OwVpGR0O; 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 d19si11892743ejj.468.2020.08.04.00.21.07; Tue, 04 Aug 2020 00:21:30 -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=@kernel.org header.s=default header.b=OwVpGR0O; 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 S1729567AbgHDHS4 (ORCPT + 99 others); Tue, 4 Aug 2020 03:18:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbgHDHSz (ORCPT ); Tue, 4 Aug 2020 03:18:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 078552076C; Tue, 4 Aug 2020 07:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596525535; bh=hfBcjPkGkyJcxN+uBmeH4V4WssMYKsI4OSjMhe3j9nE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OwVpGR0Ok0sLNItVNHru4lTDPUkTdpzFDk8L3/KmtmbkchGcz4R2Ofi5pahs9dwmh asvWs/5rINuqvXq0fIVnio+kCnED4NAxfCXUI1twJjGLXTUytelaxJgyGr97pMrPcW V/676XUzfCd7Jei4O+TkZeXTbaVUD4DEDlAOKHvU= Date: Tue, 4 Aug 2020 09:18:36 +0200 From: Greg Kroah-Hartman To: Pavel Machek Cc: 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: <20200804071836.GA1416416@kroah.com> References: <20200803121850.306734207@linuxfoundation.org> <20200803121850.766021165@linuxfoundation.org> <20200804071132.d6awebnvt7gnqfkb@duo.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200804071132.d6awebnvt7gnqfkb@duo.ucw.cz> 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: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? thanks, greg k-h