Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp205793imu; Mon, 26 Nov 2018 19:43:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vxj9ARaBKdMAJYiEJ+PUf3Q6DJw8y6AXzlvuSB7WStGh+rVIaf0wN3kiHtjPBw2rqRMenn X-Received: by 2002:a65:4646:: with SMTP id k6mr27091826pgr.153.1543290200172; Mon, 26 Nov 2018 19:43:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543290200; cv=none; d=google.com; s=arc-20160816; b=DMj1fmqa+dHs7R/ZCItP3NdRAhMGSGe6Ci/yJC0ZPbGkH/dvsR/mK6czlGZSQ48fQv l8fLEx8ZDNG3HeZla4rfuX5zhiih7xxgL5i05JJh6pPcAgq6W9S1ESGnD4q8JRuE5Aks hWkuVL8s8Mq62NQzefsO4zOgXM08vieVAsydPf/lerrXX6H5aMo+WJfyyrBHejRiygI4 x1c0PJibzeOCSIvBpTZdc2ELjiOXQp1MEDuK+I2m5lmBCEfICs8xvpjMJZBuU0t94wjB 6KxGy1e7zvFE8ZLJuN3KjEiJRW27tjw+SsrI746oBs8StOdAUJyDw4JMvnKNqISfwuHn N7bg== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=mIQgz3PVbJSwUOKlLJVVRI40liEChb8dCyo14gzK5SA=; b=V2ESCKibEzlauhNiLXuQ7kJSWPePtMuiy3nSZAx/BuCJbSvASHmHCy9v2SbEteMn7E 0esM4YBINAPlW04Z7D4n+t6uPiDrdHk7asMlhVP3Zef3ulOnUlkhcjy4f6G3tPzHUS8W c8uhGE9hLeKIGRaljgmupkBke7T+rOH9RElF9SQtLDNWxPxi7GdP0ps2dtrMhpTAQeGB R+R72RWfcg2UfW+0tlJP5Zx16xeLEWkdElbTh216PebcEyoDq6JiBemQ9M3VSfBLadTY gn3pjzmM6962FWPLLrbRWLgprNcsLKkyBAJTQ+zazY/3dquPPMAqWlAD2MvJN9gC5HRa M6tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=aWWnlOXD; 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 n3si2536663pld.36.2018.11.26.19.42.49; Mon, 26 Nov 2018 19:43:20 -0800 (PST) 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=@163.com header.s=s110527 header.b=aWWnlOXD; 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 S1728245AbeK0OUd (ORCPT + 99 others); Tue, 27 Nov 2018 09:20:33 -0500 Received: from m12-15.163.com ([220.181.12.15]:60390 "EHLO m12-15.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727633AbeK0OUd (ORCPT ); Tue, 27 Nov 2018 09:20:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version; bh=mIQgz 3PVbJSwUOKlLJVVRI40liEChb8dCyo14gzK5SA=; b=aWWnlOXDKNF4+TZjno3YE D5FCn/D/ZYv0T/5ltktmKz58QQYsqfPUvdcII3//zbFtzE+VQfPBk+oa2wkXKxnf hqNsv7TJ5cx7FGwqCNzBjJhmTt9jslKoak5B3Y3VvkLQJsRa+GVQuTMVpJa3e0Xw 8MEKLAhf83vR8w6ZwkdoDM= Received: from bp (unknown [106.120.213.96]) by smtp11 (Coremail) with SMTP id D8CowABXGR+RuPxbxoCGAA--.4971S2; Tue, 27 Nov 2018 11:22:57 +0800 (CST) Date: Tue, 27 Nov 2018 11:22:58 +0800 From: PanBian To: Chao Yu Cc: Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] f2fs: read page index before freeing Message-ID: <20181127032258.GA127317@bp> Reply-To: PanBian References: <1542884326-74903-1-git-send-email-bianpan2016@163.com> <3ebe6814-586e-77e8-52fa-47fb61d760f5@huawei.com> <20181126102841.GA94853@bp> <20181127002247.GA109273@bp> <28fc6dc0-6f91-1551-57bb-769dc18b9f7b@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <28fc6dc0-6f91-1551-57bb-769dc18b9f7b@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-CM-TRANSID: D8CowABXGR+RuPxbxoCGAA--.4971S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tw1Duw1UAw43XryrWFWUXFb_yoW8Gw48pr yfJa48KF4vqr1Uurn2vw1rZ3W0qrsrJr98Wr1rWry09wn0vrn5JrnFyr4UKry2kr1kt3WI yF4jqas7Z3yjya7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jumhwUUUUU= X-Originating-IP: [106.120.213.96] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/1tbiNhEMclWBcWDJgQAAsU Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 27, 2018 at 11:12:40AM +0800, Chao Yu wrote: > On 2018/11/27 8:22, PanBian wrote: > > On Mon, Nov 26, 2018 at 07:07:08PM +0800, Chao Yu wrote: > >> On 2018/11/26 18:28, PanBian wrote: > >>> On Mon, Nov 26, 2018 at 05:13:53PM +0800, Chao Yu wrote: > >>>> Hi Pan, > >>>> > >>>> On 2018/11/22 18:58, Pan Bian wrote: > >>>>> The function truncate_node frees the page with f2fs_put_page. However, > >>>>> the page index is read after that. So, the patch reads the index before > >>>>> freeing the page. > >>>> > >>>> I notice that you found another use-after-free bug in ext4, out of > >>>> curiosity, I'd like to ask how do you find those bugs? by tool or code review? > >>> > >>> I found such bugs by the aid of a tool I wrote recently. I designed a method > >>> to automatically find paired alloc/free functions. With such functions, I > >>> wrote two checkers, one to check mismatched alloc/free bugs, the other to > >>> check use-after-free and double-free bugs. > >> > >> Excellent! Do you have any plan to open its source or announce it w/ binary > >> to linux kernel developers, I think w/ it we can help to improve kernel's > >> code quality efficiently. > > > > Yes. I am now writing a paper about the method. I will open the source code > > as soon as I complete the paper and some optimizations. > > Cool, if there is any progress, please let f2fs guys know, thank you in > advance. :) No problem. It's my honor to apply my tool to the Linux kernel. > > Thanks, >