From: Christoph Hellwig <hch@infradead.org>
To: Lukas Czerner <lczerner@redhat.com>
Cc: hch@infradead.org, xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: fix possible overflow in xfs_ioc_trim()
Date: Tue, 6 Sep 2011 10:02:38 -0400 [thread overview]
Message-ID: <20110906140238.GA11643@infradead.org> (raw)
In-Reply-To: <1315233205-27093-1-git-send-email-lczerner@redhat.com>
On Mon, Sep 05, 2011 at 04:33:25PM +0200, Lukas Czerner wrote:
> In xfs_ioc_trim it is possible that start+len might overflow. Fix it by
> decrementing the len so that start+len equals to the file system size in
> the worst case.
The idea of the check looks reasonable, but I think it needs to be done
a bit different. Was this caught by the new testcase you just sent?
> + xfs_fsblock_t max_blks = XFS_MAX_DBLOCKS(&(mp->m_sb));
XFS_MAX_DBLOCKS is the maximum number of blocks that the given
geometry could support. But the last AG could be shorter than the
others. I think you really want to check against mp->m_sb.sb_dblocks.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2011-09-06 14:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-05 14:33 [PATCH] xfs: fix possible overflow in xfs_ioc_trim() Lukas Czerner
2011-09-06 14:02 ` Christoph Hellwig [this message]
2011-09-06 14:54 ` Lukas Czerner
2011-09-07 14:13 ` Chandra Seetharaman
2011-09-07 15:06 ` Lukas Czerner
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=20110906140238.GA11643@infradead.org \
--to=hch@infradead.org \
--cc=lczerner@redhat.com \
--cc=xfs@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox