Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp265851pxx; Thu, 29 Oct 2020 01:59:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHVJMN2NJ80VK1PgbbsM69h2xDmFEv/b4MLDWcyEaffSFKmSAFlIR/9xZcbDkQOKQK8YNs X-Received: by 2002:a17:906:1a07:: with SMTP id i7mr2903333ejf.473.1603961974426; Thu, 29 Oct 2020 01:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603961974; cv=none; d=google.com; s=arc-20160816; b=EjhgZ/I7l/BYU0HoONK9+zKCHO9e0DZkd/4m1Qk2IIU8/2vGMJJl4i4jGFrDBXax0l wPGXUK426+cjekV1C7RR7/H4YILrDli3iJsF9zH73j6PZAEwGgzt6ZKujWFrz6d/T2GJ lNuJZrFyzibdY+A1PjVqslSW6PeP8BD1nrB3UR40BZoQldBuRWVMOvNjkx8lzjXgwRiS TOb15NnYxNCi1SU7dk05BRQUwS7NUq2j1/yxGqbrlcphUpdGaziQWXS79EqbVGtcirVD cLBNjzAaZuTKa+cL0rRHqJnOvYy191n208lnIowwTkoQX7HX+MVvYnzxmTIpJWlldyqD YVVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=7Ba4g29blt+vTrk5UqJDjcvG/7F/KBccJCo26EITui0=; b=XSau41yJ6CFxI8JZ/4QHAzvUXmbPGTZgcClfsAMPxUBlVs+eiwORhH+mpEX/K21JBh HWKciwdfIqy/4fHi0cAv7xHKasrDWKyljXPIvtAo7XJASGAuppidhZAAeTWhaWVyVdgA QfwOQ1U+WmknuK6Q1VWGgxhnFeaxkuuVc0pAAFzvL6M6I9N9n9jnPJUEEgVIV7rDbV05 t7TZCWJ/cEOH/miD5MFlFYt0YIdE4ejpia6S4AFXacfD99uf5z5CAmUtes4T3zuVE9oc iwtXCWVYnwOBbuvHwF2gLctjvNIVSdaKBYtFR2+HdL9/DJiNEoYIYF71rlhItCry0agU KMHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 i20si1350062ejh.16.2020.10.29.01.59.10; Thu, 29 Oct 2020 01:59:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726108AbgJ2HVS (ORCPT + 99 others); Thu, 29 Oct 2020 03:21:18 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:37991 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725962AbgJ2HUw (ORCPT ); Thu, 29 Oct 2020 03:20:52 -0400 Received: from callcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 09T4EpDA023037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Oct 2020 00:14:51 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 36255420107; Thu, 29 Oct 2020 00:14:51 -0400 (EDT) Date: Thu, 29 Oct 2020 00:14:51 -0400 From: "Theodore Y. Ts'o" To: yangerkun Cc: jack@suse.com, adilger@dilger.ca, linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext4: do not use extent after put_bh Message-ID: <20201029041451.GT5691@mit.edu> References: <20201028055617.2569255-1-yangerkun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201028055617.2569255-1-yangerkun@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Oct 28, 2020 at 01:56:17PM +0800, yangerkun wrote: > ext4_ext_search_right will read more extent block and call put_bh after > we get the information we need. However ret_ex will break this and may > cause use-after-free once pagecache has been freed. Fix it by dup the > extent we need. > > Signed-off-by: yangerkun Good catch! Thanks, applied. - Ted