From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89E95C433B4 for ; Mon, 26 Apr 2021 08:39:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4395561107 for ; Mon, 26 Apr 2021 08:39:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232080AbhDZIk3 (ORCPT ); Mon, 26 Apr 2021 04:40:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:47602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232343AbhDZIk2 (ORCPT ); Mon, 26 Apr 2021 04:40:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 62FBE61026; Mon, 26 Apr 2021 08:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619426386; bh=qmBzYEu9Br729+JjbL2iaRcxwkLblYZWZBSJZ2/X8/Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lH5OXRYLfOWxZiREksdAwmEnsT8uPwGz1gPWQxo+539jCrJHkiAvwHr79nBWap9aX mizyB0PaixVznKf6/4OzIBR3ioif4mYLagBPE90oNdwlVfOCq7W6Y8u9WDyD35tYju kksypEFnXbtXbrgAl00EFoI1M9bzz0rizcMQQbmw= Date: Mon, 26 Apr 2021 10:39:44 +0200 From: Greg Kroah-Hartman To: Gao Xiang Cc: stable@vger.kernel.org, linux-erofs@lists.ozlabs.org, Chao Yu Subject: Re: [PATCH for-4.19] erofs: fix extended inode could cross boundary Message-ID: References: <20210426082933.4040996-1-hsiangkao@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210426082933.4040996-1-hsiangkao@redhat.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Apr 26, 2021 at 04:29:33PM +0800, Gao Xiang wrote: > commit 0dcd3c94e02438f4a571690e26f4ee997524102a upstream. > > 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+ > Link: https://lore.kernel.org/r/20200729175801.GA23973@xiangao.remote.csb > Reviewed-by: Chao Yu > [ Gao Xiang: resolve non-trivial conflicts for latest 4.19.y. ] > Signed-off-by: Gao Xiang > --- > drivers/staging/erofs/inode.c | 135 ++++++++++++++++++++++------------ > 1 file changed, 90 insertions(+), 45 deletions(-) Thanks for the backport, I'll queue it up after this latest round of stable kernels is released later this week. greg k-h