Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2016203pxa; Mon, 3 Aug 2020 05:28:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJgSDJHCUR+g8uqtKdgu7NQCmwtf99DYvK5wkW9KniEaYyp7Bds6YCwUVuQ+clw1cewQzA X-Received: by 2002:a17:906:6b87:: with SMTP id l7mr15704113ejr.198.1596457688202; Mon, 03 Aug 2020 05:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596457688; cv=none; d=google.com; s=arc-20160816; b=TLcCl8o7Y/Fzx9nwS5NyDnKByQFh7bfNOpP/rP2ItRWAJsQlD0KEi0U7odwFoH+NJv K4Nn6A4s2cbqdQPNexFSGbfeVNb6nx+1bH90V+lS8G+HPGxGDncEkNFCl71OOei+48d7 TYmNq3llWcbSfYC9Z/0BVxwCOmxDSKpYQ1HJB46UgbjB3QFXXG/k2fBFMUYzncq+okfh Dkm/GPBpInz4vDlnZKnqEyw0T6Vj55JR3vrQJsa1R3jATvL5Dq7HUVyRWmBBSsDri6gY DaohSiPDVOyyCqJVi7Zs7VXJpGu4txu7FBVG+HDRk6g1Six36JIPSiiLlpVuoeYgKy33 QSaA== 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=XG3zA95CJ9clTDEGenWsiTutuyYW73JC1jKvtXhyni0=; b=ESSgIFUiSoy4yA8f1Ma/r7wVlmsFhCMZwVjFeXudvTVOG9aj/9X9k2vXHJpO6ii2Ph WuAVN852eCQYQv8B/II8TcV8WHhAA+HcdC4EWAgjanu/SiwGd+6ycBYPLqKDtPCZZ/H5 nFWeA5Vo0AwZ+XeY7cE7LYr6ISTpwQrOjwZNhKufKVzNj185Wyl2Gks5OZydgyvqAcyB oTKkTnWcjHUENAXuQmZ1VdiwmvSiGkoMx62oCp8h2KHpjymCj1Mrp471GWLQ3FSIkiFd Cx1u/ufLAbbFor01H47S+hTQ8hHl/XQmHDWi6B+2gZSkiJr94sEgtv/uodyUtKHXH/Yk q2Xw== 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 t17si2642981edv.436.2020.08.03.05.27.46; Mon, 03 Aug 2020 05:28:08 -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 S1727864AbgHCM0d (ORCPT + 99 others); Mon, 3 Aug 2020 08:26:33 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:47136 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728362AbgHCM03 (ORCPT ); Mon, 3 Aug 2020 08:26:29 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 6BD612846B9A9A6760EE; Mon, 3 Aug 2020 20:26:27 +0800 (CST) Received: from [10.164.122.247] (10.164.122.247) by smtp.huawei.com (10.3.19.203) with Microsoft SMTP Server (TLS) id 14.3.487.0; Mon, 3 Aug 2020 20:26:22 +0800 Subject: Re: [PATCH] erofs: fix extended inode could cross boundary To: Gao Xiang , CC: LKML , Chao Yu , References: <20200729175801.GA23973@xiangao.remote.csb> From: Chao Yu Message-ID: <54db9f70-5c4e-8ba4-0a14-ff6b792fe5b4@huawei.com> Date: Mon, 3 Aug 2020 20:26:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200729175801.GA23973@xiangao.remote.csb> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.164.122.247] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/7/30 1:58, Gao Xiang wrote: > Each ondisk inode should be aligned with inode slot boundary > (32-byte alignment) because of nid calculation formula, so all > compact inodes (32 byte) cannot across page boundary. However, > extended inode is now 64-byte form, which can across page boundary > in principle if the location is specified on purpose, although > it's hard to be generated by mkfs due to the allocation policy > and rarely used by Android use case now mainly for > 4GiB files. > > For now, only two fields `i_ctime_nsec` and `i_nlink' couldn't > be read from disk properly and cause out-of-bound memory read > with random value. > > Let's fix now. > > Fixes: 431339ba9042 ("staging: erofs: add inode operations") > Cc: # 4.19+ > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,