Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp98803pxa; Tue, 4 Aug 2020 00:12:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPxgbD8N3K/hZatokHdyywTCG1Iydn+JUHnY1ckrK2uqRFkMPxtwmh0BRbDheHnZKlKbgY X-Received: by 2002:aa7:d9d7:: with SMTP id v23mr19900064eds.112.1596525136319; Tue, 04 Aug 2020 00:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596525136; cv=none; d=google.com; s=arc-20160816; b=iVwl7rnKDF/uVujoBmLyj36NGqd5UDjAwl1oUq52op12JEyqKjXnxdtzeQ1LUej+LP DuHe7O0edKPqPEihrpA0bCDJW73fRcM8hLHypfApt4pvk6asMS7sdoN8vh1HnWsvs2cm ekdZWP34Ce0huTAumxmasK0Ofz7BdBi9/NTlwL6m/GsChw5L4xWoXU5ON/RaWO7rUs15 X0VPh3Ono87gvqxWKNdvQj4y4HRdzRrSArGW5/dTwa2hGF1cRZkZkv9E/IFmSGdCnqui XkLk0fb9LTCg2TAGAdcJD+5Bb4kV8Hagl8BSwm1bpXb/5lvv8DImczA2TBKTIZ+TzRhT sQ1w== 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:message-id:subject:cc :to:from:date; bh=1pyp1j3AOApWWaUWrG7Nf1NC0E90XuaeFBOUtyYsZA4=; b=zhxDPbC6f34HAZbWys47VyfJI4BqCVvXRfOOETPGQQPo8l6IjTtB/9Woy85CI4zqbH GMf7vJYV9chancL7RKnUegJbMhxJtFJ6yp9SqtB7XpfKG6WwrW6upo/3H8Kkc853If8B qZ/8NEa1YyBViRp6beJcP5gTTiWLeT2HWDyfMDKGk3bkYfD6e9jbz9NxmneHODEq5OgS atU5CPm+wlLmiAlMW4qbxfTAJRUCj7SiMIT8xDiCtg+ccsIbh90ZE4/tnGLs2R5VOLEZ 2DigJkRnkxJdk+BIHLoP05UMYfdNWOdlf7SM3C2/nUwThdVRD8HCFRQa2490jO4sgkaA TOIw== 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 rl4si12225282ejb.648.2020.08.04.00.11.54; Tue, 04 Aug 2020 00:12:16 -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 S1726656AbgHDHLh (ORCPT + 99 others); Tue, 4 Aug 2020 03:11:37 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:46652 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725300AbgHDHLh (ORCPT ); Tue, 4 Aug 2020 03:11:37 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id E137A1C0BD7; Tue, 4 Aug 2020 09:11:32 +0200 (CEST) Date: Tue, 4 Aug 2020 09:11:32 +0200 From: Pavel Machek To: Greg Kroah-Hartman 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: <20200804071132.d6awebnvt7gnqfkb@duo.ucw.cz> References: <20200803121850.306734207@linuxfoundation.org> <20200803121850.766021165@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yjcilnnh4hcnw3yn" Content-Disposition: inline In-Reply-To: <20200803121850.766021165@linuxfoundation.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --yjcilnnh4hcnw3yn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > @@ -6993,6 +7010,14 @@ struct extent_map *btrfs_get_extent(struct btrfs_i= node *inode, > extent_start =3D found_key.offset; > if (found_type =3D=3D BTRFS_FILE_EXTENT_REG || > found_type =3D=3D BTRFS_FILE_EXTENT_PREALLOC) { > + /* Only regular file could have regular/prealloc extent */ > + if (!S_ISREG(inode->vfs_inode.i_mode)) { > + ret =3D -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. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --yjcilnnh4hcnw3yn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXykKJAAKCRAw5/Bqldv6 8lPtAKCAuPe8M3HnW3Z3IA/nVTAhwsI54gCfesblQgYJ/89COm5D1BJQiW3/AVM= =dtAj -----END PGP SIGNATURE----- --yjcilnnh4hcnw3yn--