Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1706234ybz; Thu, 23 Apr 2020 04:17:56 -0700 (PDT) X-Google-Smtp-Source: APiQypI5iEFb62p3UC+tvxGpR61MfxFwa7FQC6BXc7DS8u4TGl7aeIaMF/ezvNfxZHUIvNa39qYx X-Received: by 2002:a05:6402:21d7:: with SMTP id bi23mr2155056edb.176.1587640676406; Thu, 23 Apr 2020 04:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587640676; cv=none; d=google.com; s=arc-20160816; b=Fe4rldhzOk01UC14K1Hfnzg+Jrs2AHGoPaOYi0M/nmGypMMMg7708A+nSYLpiD6biR tuk4TrF2mCrDmo6xBWFfoZyQ6qIwMkjH0oOEEnrF+saGWzw8dUp5Mnk+ioD48jIVxyqB /bRjBdSklUfAmlK/bEnC3RQ2NNajzJodTPPtp9YFjdJ6Holc56+Q5CL1aJxOuhs7sunZ 2Ii/DSEuMM1x/uORsjZrgiCyB/sRIApZDx3qX/fsOCs4A0eVyiPSvs75IHBxsUESdfEJ QDySIFOxOsESZYDpv1Kfe548qli/TnkOMU6SsFtJkzzMhVXTJg8Riz+PzATwYU6j0Jdm iRQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qsAta9oCDSAhCxRIvhj4+s09tsTuQHPbcT9Wkg5QNKo=; b=mDAXOdRTysep0XPwR27fI9KHjE5fQDW3NRnreW7ASS7By9dIp3a0vX8lLHSKafUXyZ x3fqvjRgzomlXNuiuTSpgiT3mxInKgmkDE+uhhCzObhiQx5QoLRyaUgt85Qz6RQdgdAH VUk6YwjiRzRUAGuYTewJY0EQCIB8mY8TApZ182YxPlgVebrNhMM5FZFwZr+6V4qglYV3 3PMg+6Moegx8RHISceDDFrr2wi/aYGJ0ToDdjOvTSeL7pp+izH2jCLyNc4W2lLSZvRrJ Q59Hmmd4HflKP1E4OKW8zz4Mqw+RjpA/m/DwScbCJvkg6ldHZHIUOvi2Vkg1A3xPX0rq Uq2g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si995632edq.359.2020.04.23.04.17.31; Thu, 23 Apr 2020 04:17:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727862AbgDWLQj (ORCPT + 99 others); Thu, 23 Apr 2020 07:16:39 -0400 Received: from mx2.suse.de ([195.135.220.15]:53384 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgDWLQj (ORCPT ); Thu, 23 Apr 2020 07:16:39 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D5D67B080; Thu, 23 Apr 2020 11:16:36 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id C274F1E1293; Thu, 23 Apr 2020 13:16:36 +0200 (CEST) Date: Thu, 23 Apr 2020 13:16:36 +0200 From: Jan Kara To: Ritesh Harjani Cc: linux-ext4@vger.kernel.org, jack@suse.cz, tytso@mit.edu, adilger@dilger.ca, darrick.wong@oracle.com, hch@infradead.org, Alexander Viro , Dan Carpenter , "Aneesh Kumar K . V" , Murphy Zhou , Miklos Szeredi , Amir Goldstein , linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, syzbot+77fa5bdb65cc39711820@syzkaller.appspotmail.com Subject: Re: [PATCH 1/5] ext4: Fix EXT4_MAX_LOGICAL_BLOCK macro Message-ID: <20200423111636.GH3737@quack2.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 23-04-20 16:17:53, Ritesh Harjani wrote: > 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 The patch looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > 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 91eb4381cae5..ad2dbf6e4924 100644 > --- a/fs/ext4/ext4.h > +++ b/fs/ext4/ext4.h > @@ -722,7 +722,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 > -- > 2.21.0 > -- Jan Kara SUSE Labs, CR