Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5509742imu; Mon, 26 Nov 2018 01:14:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wupu+qwMFLrQW8SKxAKGSprulY1+kBz+3ZjuIN9gMCfqr9+9x5ONOWSqGh+pwlX4JIB8ie X-Received: by 2002:a17:902:2b8a:: with SMTP id l10mr25335359plb.70.1543223697169; Mon, 26 Nov 2018 01:14:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543223697; cv=none; d=google.com; s=arc-20160816; b=Im2QbepVhb4sfytKQlpy1arKG1o9sDIciR1wdMvkcKmu0Hc6hnwaJeqk20J4sWmb8D EbnJA/WWDm5IOIzlmy41xiT8cyOmo9OKvwpGiTLkx0xvFKk/Bdi7tPpIhGAX8LST230G fk8HQDm4ZzOZbdIjt7vAEKggFJbflv/D6jVzt/3WgD47Kki4n41ARnqTBKrIwhe7Vhyt G/ST7qNNP3w/0yUJaZoVawEpZ/EFCoiUS8WkfreJG2Ml2k2oCmuhnKeGTguzvp5OfkBh 5DDlQMJQdabMLMwUs5yq7nzXoWQk3VjFlegNXCknaAvgbQ577dOcGauxTlAj7dPOZvAO g2Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=vZNhf3yB8akHQ0WF+dd85F8JV7zi6eMgOcIRqkEAruo=; b=Mq7c+rNzLLiDPVtl2wVn+8iPMvqeCrtooMm2XnPFsG1Gcj3QyfpfsxfmVqdRsarHD4 W/1RrKeVxc0LI+wvYkrdeVflQGzSZNAq3VHk6iHSzxK7KSJUcTZWMJi37/ymOO0sR7ua bw56dJGC5UE/iTyjaEw+Lz6w/+6ycQxszXXHgTV3iBn1Cxmgx9QkO4LrJ789iX8iYAuo HsT5ioYMlmnx3xu43HYLIG/0dp3vdq9O5JRQbEur97UbfImtb8XUyc3WFuXxrHYaygJi kauIqO6OREDQWphQPNjBHOreU21DSw7y+8hpkX/o/ifp3Sd9pIwBxt53ZH7bj7CaoDYI eXGA== ARC-Authentication-Results: i=1; mx.google.com; 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 c3si41208130plr.178.2018.11.26.01.14.41; Mon, 26 Nov 2018 01:14:57 -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; 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 S1726261AbeKZUH1 (ORCPT + 99 others); Mon, 26 Nov 2018 15:07:27 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:15602 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726157AbeKZUH1 (ORCPT ); Mon, 26 Nov 2018 15:07:27 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 91DCDCCAAC64; Mon, 26 Nov 2018 17:13:55 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.408.0; Mon, 26 Nov 2018 17:13:54 +0800 Subject: Re: [PATCH] f2fs: read page index before freeing To: Pan Bian , Jaegeuk Kim CC: , References: <1542884326-74903-1-git-send-email-bianpan2016@163.com> From: Chao Yu Message-ID: <3ebe6814-586e-77e8-52fa-47fb61d760f5@huawei.com> Date: Mon, 26 Nov 2018 17:13:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1542884326-74903-1-git-send-email-bianpan2016@163.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks,