From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: rewrite getbmap using the xfs_iext_* helpers
Date: Thu, 21 Sep 2017 15:36:10 +0200 [thread overview]
Message-ID: <20170921133610.GD13541@lst.de> (raw)
In-Reply-To: <20170920230824.GC7112@magnolia>
On Wed, Sep 20, 2017 at 04:08:24PM -0700, Darrick J. Wong wrote:
> > I'm still wondering why we allocate a potentially large getbmapx buffer,
> > fill it out, and only then format the results to userspace? I think
> > getbmap (the ioctl) is now the only user of these functions, so can't
> > we just call the formatter directly from _getbmap_report_one and
> > _getbmap_report_hole, like what getfsmap does?
> >
> > (I also feel like I've asked this before, so apologies if I'm merely
> > forgetting the answer.)
>
> Oh right, it's because we have the inode locked, and copying things to
> userspace could incur a page fault, which we can't risk with the inode
> locked because some malicious person could create a fragmented file with
> a bmap request header at the start of the file, mmap the file, and call
> bmap on the fragmented file with the pointer being the mmap region.
Yes.
Can I get a Reviewed-by: tag now? :)
next prev parent reply other threads:[~2017-09-21 13:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 15:26 getbmap refactor V2 Christoph Hellwig
2017-09-18 15:26 ` [PATCH 1/2] xfs: rewrite getbmap using the xfs_iext_* helpers Christoph Hellwig
2017-09-20 13:23 ` Brian Foster
2017-09-20 14:41 ` Christoph Hellwig
2017-09-20 17:03 ` Darrick J. Wong
2017-09-20 23:00 ` Darrick J. Wong
2017-09-20 23:08 ` Darrick J. Wong
2017-09-21 13:36 ` Christoph Hellwig [this message]
2017-09-21 15:35 ` Darrick J. Wong
2017-09-21 13:35 ` Christoph Hellwig
2017-09-21 15:40 ` Darrick J. Wong
2017-09-18 15:26 ` [PATCH 2/2] xfs: simplify the xfs_getbmap interface Christoph Hellwig
2017-09-20 23:08 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2017-09-03 15:51 [PATCH 1/2] xfs: rewrite getbmap using the xfs_iext_* helpers Christoph Hellwig
2017-09-11 15:49 ` Brian Foster
2017-09-17 21:44 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170921133610.GD13541@lst.de \
--to=hch@lst.de \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.