Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3151407ybk; Mon, 18 May 2020 19:44:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCdVqEK7/trzeIIw4KiA5HoSLJJc0+DIbnZVDtVuhXawF9CCqZkLB0FEKpXaFl5DRzwnyU X-Received: by 2002:a50:d619:: with SMTP id x25mr16712691edi.200.1589856274314; Mon, 18 May 2020 19:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589856274; cv=none; d=google.com; s=arc-20160816; b=h4Brd/VQDhyrGEm2cD/nEw/cJq6V30SoQBbsnTI2Fae6SXJ7vjCwObMslBlEobZewZ 7rmHBEpzr8zcgg4zRpPaQBZUWYNhaVik7w8pjfI+4SVCl4LjGlHE61UBr3zElLkJIEH7 t0hn/dYQKV0AnJTe8xadC5AsEpmBbIB4Fxju/2AHsKN2Zm8gjrtoBadDhBTvG/V0102J hGNvdfHhYT/sat69W/6vFQl++BgISjnA9JH/Igo74vOjQSlIdTvZ6Tke8/gbV24W26Xw pM2Uu8iJ8RXXHTGaXty47HmOXXNEacjOOww4bTfDc0jeBse9Ni6QT/iRFDFYsG2Qkvlo 2xLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=cFdKWhemCr8tqvr3h+vuaX6m9GdwfIHQ43GFK/Jf/pI=; b=xo5KZC8TOthWCLmfPuz4HjeNIZitA+gaRVftCtSpJ3VbvvMugnstDh0BAdpvORULJE /n2j8kR3P8zxeGoJHEiy5xoBza2VCOGkCZmg1+eu8XhfX9Xo72UIcjKVe60jPc6z2/w5 KL2+j12mTR4jZbPfMzaXxbfdGyukUmyfZk7Q/T3VIVz4dqtFP8vOLXIOrI919wDSbNF5 HQJazknmQtgtVDjJp8VG57mg+CsQn9BWXV9tH879xnwh7O0q6SDt2+knIvuCzu1+QpX+ /RpWwiovFyDQcnxImYqvjUgvXn4nvTGbap2GHTAHV1mje0z+f1f68anROFQsJ14AZ8zq l76A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Y/bDmEUL"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si7721181eja.345.2020.05.18.19.44.02; Mon, 18 May 2020 19:44:34 -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=@gmail.com header.s=20161025 header.b="Y/bDmEUL"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726700AbgESCnU (ORCPT + 99 others); Mon, 18 May 2020 22:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726302AbgESCnU (ORCPT ); Mon, 18 May 2020 22:43:20 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D70FC061A0C; Mon, 18 May 2020 19:43:20 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id z15so638821pjb.0; Mon, 18 May 2020 19:43:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cFdKWhemCr8tqvr3h+vuaX6m9GdwfIHQ43GFK/Jf/pI=; b=Y/bDmEULPyPvMeyR/Vt/m7qXOIFlc53jGiI1lzonVc1dCAUvMOdnCAswQHMgdriesL 1BlDn0J48UxSX8XRve1lKIZSz0gOIo1cppxRAyWm48W4e9ndjVhxnau/Y0LTBC8kWuU4 CZs4d6t4v1RC2xw2QqHsq3dw6nPlbuCCLGt/Encf/UQdSK6pyMLcMULqfNSZHtK3Ma98 foyfQpDSeQHHDrbeByiN17jblCXLcZxcOco8Bio8nJ5ccU/AIK1r/z1g0zYCUcZsh8xp NbjKn7FckTQPzoaGOSK6h7N6FOlkc2zbq/6W+m/WdLeQIfclUuA6gr2mMWU1e1Byt1E4 XLAQ== 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; bh=cFdKWhemCr8tqvr3h+vuaX6m9GdwfIHQ43GFK/Jf/pI=; b=Uxzqj4ITDXw4/sS5nh+pBnzwfb3W4je/sB6g62iD2uDWBgSOsWQpTo/JzENYeW2UaP q4rsFWC8el7k+XuAD0dY8g8KZDNxLzsPtwiytQ/zXYjWr5r1DbShuy8IHvMtwCUD8yPq 40iifJUxYubK+SHrRCH3ta3cowCXipLb+seMAPZGT9AyIoTUNDSxQv/FUmtN4Z7hqveu MZQvAFaDcKkKfO1qRPRw4dnhS2sOzwjiTzb0iUjeKJVg+DmEtKoEpLVvub/a14PEtiLq LcNHi6/zNZS1SjFtHaqR70cmfkZvvsHQIZxR+e55u+ySM8r9VSR2ONGs/P+WKi9blqfV 6bzw== X-Gm-Message-State: AOAM533BmVqIzQJVZcPx6g+AhhqxKu9OrCMO/QUni8SmlCZMHoEqw597 6RA4Lgx4xiKm8tKSW37XGZjuM6S0 X-Received: by 2002:a17:90a:d78e:: with SMTP id z14mr2583854pju.155.1589856199982; Mon, 18 May 2020 19:43:19 -0700 (PDT) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id z20sm5555472pgv.52.2020.05.18.19.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 19:43:19 -0700 (PDT) Date: Tue, 19 May 2020 10:43:11 +0800 From: Murphy Zhou 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 Subject: Re: [PATCH 0/5] ext4/overlayfs: fiemap related fixes Message-ID: <20200519024311.7bkxi2fkxboon2ig@xzhoux.usersys.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Apr 23, 2020 at 04:17:52PM +0530, Ritesh Harjani wrote: > Hello All, > > Here are some changes, which as I understand, takes the right approach in fixing > the offset/length bounds check problem reported in threads [1]-[2]. > These warnings in iomap_apply/ext4 path are reported after ext4_fiemap() > was moved to use iomap framework and when overlayfs is mounted on top of ext4. > Though the issues were identified after ext4 moved to iomap framework, but > these changes tries to fix the problem which are anyways present in current code > irrespective of ext4 using iomap framework for fiemap or not. Ping? > > Patch 1 & 4 commit msg may give more details of the problem. > > Tests done > ========== > 1. Tested xfstest-suite with "-g quick" & "-overlay -g quick" configuration > on a 4k blocksize on x86 & Power. There were no new failures reported > due to these changes. > 2. Tested syzcaller reported problem with this change. [1] > 3. Tested below change which was reported by Murphy. [2] > The minimal reproducer is: > ------------------------------------- > fallocate -l 256M test.img > mkfs.ext4 -Fq -b 4096 -I 256 test.img > mkdir -p test > mount -o loop test.img test || exit > pushd test > rm -rf l u w m > mkdir -p l u w m > mount -t overlay -o lowerdir=l,upperdir=u,workdir=w overlay m || exit > xfs_io -f -c "pwrite 0 4096" -c "fiemap" m/tf > umount m > rm -rf l u w m > popd > umount -d test > rm -rf test test.img > ------------------------------------- > > Comments/feedback are much welcome!! > > References > ========== > [1]: https://lkml.org/lkml/2020/4/11/46 > [2]: https://patchwork.ozlabs.org/project/linux-ext4/patch/20200418233231.z767yvfiupy7hwgp@xzhoux.usersys.redhat.com/ > > > Ritesh Harjani (5): > ext4: Fix EXT4_MAX_LOGICAL_BLOCK macro > ext4: Rename fiemap_check_ranges() to make it ext4 specific > vfs: EXPORT_SYMBOL for fiemap_check_ranges() > overlayfs: Check for range bounds before calling i_op->fiemap() > ext4: Get rid of ext4_fiemap_check_ranges > > fs/ext4/ext4.h | 2 +- > fs/ext4/ioctl.c | 23 ----------------------- > fs/ioctl.c | 5 +++-- > fs/overlayfs/inode.c | 7 ++++++- > include/linux/fs.h | 2 ++ > 5 files changed, 12 insertions(+), 27 deletions(-) > > -- > 2.21.0 > -- Murphy