Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp237219pxb; Wed, 18 Aug 2021 00:48:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC4fntDW7XM1NSIrz9DsAjOmsSd8FrPC3n/grWgUKaAS1xanTJbT7UHPpclqkWbopEz9ae X-Received: by 2002:a05:6e02:102f:: with SMTP id o15mr5178356ilj.104.1629272888585; Wed, 18 Aug 2021 00:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629272888; cv=none; d=google.com; s=arc-20160816; b=eNkzu1Q0ymxyuo8kC1kQkWQAMuUA+8lCCf6XFN260cZzlSauSffIUD3TXYCCyqehc2 gagIaQos0usvSFqP1GQ288d3+eSQnqZzZXW5mDSDouOXIyFWE4V2mx1RbRyCpfD2sYRT NTLoV7z+XWgYeLFvrdm+X4kAtqEVw2GCS3+9cZnINrASTM8PaCCwDgOXEDQ7JL7Ia2cb z3bJ3f1TgyzLknh+MdIQKkvufFe5GKyO02tDrsK0gaBaczWwunLCdOBLG7y3/kihSy1R qCbGmJEo4knuRxqxoe2LmIPkLMPorVpF63hJClx8wdTpxj8bpl9QdjWgtiyUpjvvW0YK gqpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8PddYKJqffBHxb+jKM1TJKvTWdxgDYJR1D+tFGhpiO8=; b=tyLnfPRnASRNZsH8BX3EmdZjLtmyejjQc/0lCaaPnLfuw4nI0MIchupZ6aqCSinSpb Gq+vBF1+PimKNGB5YErbQQg6egO8HCIeY+DZTYwhC1pxCYAOzaiBJ4Yo5XPUkojVIj/k JMvfPQLDOlsUmCUI5XrwUhY2lP/PCzF3ifFVlxD/gyDo333jDtS1bti3O8SBWdn554og nsDN8sDFj5h7NyrD6FLDUPFZPbT5aZx36VVj9p/b+5d//oV7C0hzV+23iP8/5nbvCoVL oSW1MPLIZjO9BZrs/P+RvhQhJ1AmJe/Vi2RrPgXQZyFYmKGywc/sEYRbwVzOFy0pmkkJ s2Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="RweAzN/F"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si5304017iot.103.2021.08.18.00.47.42; Wed, 18 Aug 2021 00:48:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="RweAzN/F"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238369AbhHRHsM (ORCPT + 99 others); Wed, 18 Aug 2021 03:48:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:49232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238014AbhHRHsK (ORCPT ); Wed, 18 Aug 2021 03:48:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D43A16108D; Wed, 18 Aug 2021 07:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1629272856; bh=Ww5raaylrzbIqskGneMELsHmUvPMzxgLtlRuOzHWY+s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RweAzN/F7Nq4XEXKqPJMerd1nbzrLbdmGutoBUr9bQJbMRNX6n6x6zeFeBvSVbAH0 rD1Q9gLtTnGkIoorSU1zBB2XsrVT4Kevv9KeBwNLS8pZY2Ql4iXVUHwEqEc+hcAiHT m4Mx76GrIV4sRJPGw4FpgOqb5ZCBsVqEPgntFbl8= Date: Wed, 18 Aug 2021 09:47:33 +0200 From: Greg KH To: George Kennedy Cc: tytso@mit.edu, adilger.kernel@dilger.ca, stable@vger.kernel.org, dhaval.giani@oracle.com, dan.carpenter@oracle.com, linux-ext4@vger.kernel.org, riteshh@linux.ibm.com Subject: Re: [PATCH 5.4.y 0/1] ext4: fix EXT4_MAX_LOGICAL_BLOCK macro Message-ID: References: <1629234731-20065-1-git-send-email-george.kennedy@oracle.com> <1629234731-20065-2-git-send-email-george.kennedy@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1629234731-20065-2-git-send-email-george.kennedy@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Aug 17, 2021 at 04:12:11PM -0500, George Kennedy wrote: > From: Ritesh Harjani > > ext4 supports max number of logical blocks in a file to be 0xffffffff. > (This is since ext4_extent's ee_block is __le32). > This means that EXT4_MAX_LOGICAL_BLOCK should be 0xfffffffe (starting > from 0 logical offset). This patch fixes this. > > The issue was seen when ext4 moved to iomap_fiemap API and when > overlayfs was mounted on top of ext4. Since overlayfs was missing > filemap_check_ranges(), so it could pass a arbitrary huge length which > lead to overflow of map.m_len logic. > > This patch fixes that. > > Fixes: d3b6f23f7167 ("ext4: move ext4_fiemap to use iomap framework") > Reported-by: syzbot+77fa5bdb65cc39711820@syzkaller.appspotmail.com > Signed-off-by: Ritesh Harjani > Reviewed-by: Jan Kara > Signed-off-by: Christoph Hellwig > Link: https://lore.kernel.org/r/20200505154324.3226743-2-hch@lst.de > Signed-off-by: Theodore Ts'o > (cherry picked from commit 175efa81feb8405676e0136d97b10380179c92e0) > Signed-off-by: George Kennedy > --- > fs/ext4/ext4.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h > index bf3eaa9..ae2cb15 100644 > --- a/fs/ext4/ext4.h > +++ b/fs/ext4/ext4.h > @@ -718,7 +718,7 @@ enum { > #define EXT4_MAX_BLOCK_FILE_PHYS 0xFFFFFFFF > > /* Max logical block we can support */ > -#define EXT4_MAX_LOGICAL_BLOCK 0xFFFFFFFF > +#define EXT4_MAX_LOGICAL_BLOCK 0xFFFFFFFE > > /* > * Structure of an inode on the disk > -- > 1.8.3.1 > Now queued up, thanks. greg k-h