summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_dfrag.c
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2011-09-21 13:42:30 +0400
committerAlex Elder <aelder@sgi.com>2011-10-12 06:15:07 +0400
commitc029a50d51b8a9520105ec903639de03389915d0 (patch)
treef0d3993b6429eea9f4843a3113eb9258613f30ef /fs/xfs/xfs_dfrag.c
parentd952e2f81244d6502aff126df5011fab10f92187 (diff)
downloadlinux-c029a50d51b8a9520105ec903639de03389915d0.tar.xz
xfs: fix possible overflow in xfs_ioc_trim()
In xfs_ioc_trim it is possible that computing the last allocation group to discard might overflow for big start & len values, because the result might be bigger then xfs_agnumber_t which is 32 bit long. Fix this by not allowing the start and end block of the range to be beyond the end of the file system. Note that if the start is beyond the end of the file system we have to return -EINVAL, but in the "end" case we have to truncate it to the fs size. Also introduce "end" variable, rather than using start+len which which might be more confusing to get right as this bug shows. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dfrag.c')
0 files changed, 0 insertions, 0 deletions