Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757271AbdLWDVd (ORCPT ); Fri, 22 Dec 2017 22:21:33 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2758 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756885AbdLWDVc (ORCPT ); Fri, 22 Dec 2017 22:21:32 -0500 Subject: Re: [PATCH v4] fsck.f2fs: check and fix i_namelen to avoid double free To: Chao Yu , , , CC: , , , , , , References: <1513319130-114230-1-git-send-email-yunlong.song@huawei.com> <1513603527-163036-1-git-send-email-yunlong.song@huawei.com> From: Yunlong Song Message-ID: <1d02d383-434e-bf32-1940-ff2ef790868f@huawei.com> Date: Sat, 23 Dec 2017 11:19:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.111.220.140] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 691 Lines: 28 Double free problem: Since ddr bit jump makes i_namelen a larger value (> 255),when file is not encrypted, the convert_encrypted_name will memcpy out range of en[255], when en is freed, there will be double free problem. On 2017/12/23 11:05, Chao Yu wrote: > On 2017/12/18 21:25, Yunlong Song wrote: >> v1 -> v2: use child_info to pass dentry namelen >> v2 -> v3: check child != NULL to include the F2FS_FT_ORPHAN file type >> v3 -> v4: fix the i_namelen problem of dump.f2fs、 > There is no commit log, so what do you mean about "avoid double free"? > > Other than that, looks good to me. > > Reviewed-by: Chao Yu > > Thanks, > > > . > -- Thanks, Yunlong Song