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=-17.5 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, USER_AGENT_SANE_1 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 749C7C433ED for ; Mon, 26 Apr 2021 08:43:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 35F416113D for ; Mon, 26 Apr 2021 08:43:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232340AbhDZIoG (ORCPT ); Mon, 26 Apr 2021 04:44:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35625 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232068AbhDZIoG (ORCPT ); Mon, 26 Apr 2021 04:44:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619426604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Wz6WYdlaJ9ziC7ExdEujknNmn1q4Z9TPX1vLmCnL7NU=; b=bp8s+07RUcGkiKI8bxIkA7su1sfdCKObL3XLsFUgj1ZhtfOTStlU5oI+WqRjmTixYwp08v /yJCNq+EV+8xdZa3Fl7PvHoD3qng4NSZF2SBTvn02Y6ZsP7bWYRTiOWLF6ZqYOr9RC2Gtg TeBZ5NjOw0Ak7hd4CJ3d02K+TACWAGw= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-482-pe2ucA-3NWKVIYnNJVt2pg-1; Mon, 26 Apr 2021 04:43:20 -0400 X-MC-Unique: pe2ucA-3NWKVIYnNJVt2pg-1 Received: by mail-pj1-f71.google.com with SMTP id u5-20020a17090a3fc5b029014e545d9a6eso6981094pjm.2 for ; Mon, 26 Apr 2021 01:43:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Wz6WYdlaJ9ziC7ExdEujknNmn1q4Z9TPX1vLmCnL7NU=; b=pONNExu3ENxdVXyIdqeRDEnMgGxkcydsRAec1pItSeMKawpjV8IWeSRMWC+YRDkX1U vMCT2rFV154LOWHMNZh/X2fB10hUY5VK3EFfNm8Toj7L3iSXpaGeIVOfqDWmWnsTxHwm W1JDKqsE7/d73pXqn6rwPMG3b+ZIK4KX4KqkR0AUV1GqeBXf7BTlsYUo0FFgkIJodCHJ JkxNmA6ZxmGzSXnZInyLdEj6Uwi5N5uoNBEOnaeiYP9WcD4X1u5UtxQw9t5i7Q6VOAJx 4uV0DERd+FTv+7C1arBLRQyjSkPmDYN+HhgzDLsfW7UHKSWpC2mTpwuU+z++oCUjx8Ub NEzw== X-Gm-Message-State: AOAM532JhTgMHPo999kIC/EQvIlKKiVGuWRLYk3IpeRbARI1oiOZoYZS tmwzp4pWzm36Fp2kbmGh8KBVgO8skg4Z174HU81re+2FW02Fh2BAKB5qf2zDOua4Zm/LzFze/BI 2pwrqsV5tIG441YKX X-Received: by 2002:a17:90a:a505:: with SMTP id a5mr19853535pjq.58.1619426599217; Mon, 26 Apr 2021 01:43:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzondjCaj9YscCnoJ2g1s783lMBccvbn3/Gfn0Oft7LAapuFL8XWpxpeIQsHhkVOLee47FisQ== X-Received: by 2002:a17:90a:a505:: with SMTP id a5mr19853514pjq.58.1619426599015; Mon, 26 Apr 2021 01:43:19 -0700 (PDT) Received: from xiangao.remote.csb ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id m5sm5165251pjc.10.2021.04.26.01.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 01:43:18 -0700 (PDT) Date: Mon, 26 Apr 2021 16:43:07 +0800 From: Gao Xiang To: Greg Kroah-Hartman 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: <20210426084307.GA4042836@xiangao.remote.csb> References: <20210426082933.4040996-1-hsiangkao@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Apr 26, 2021 at 10:39:44AM +0200, Greg Kroah-Hartman wrote: > 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. Thanks Greg, sorry about the delay. Sounds good to me. Thanks, Gao Xiang > > greg k-h >