xfs: check that dir block entries don't off the end of the buffer
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 21 Jul 2017 18:04:23 +0000 (11:04 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 25 Jul 2017 15:36:35 +0000 (08:36 -0700)
commit6215894e11de224183c89b001f5363912442b489
treed241509c5fdb94dc2218bffff11f98b4c2056483
parentcfaf2d034360166e569a4929dd83ae9698bed856
xfs: check that dir block entries don't off the end of the buffer

When we're checking the entries in a directory buffer, make sure that
the entry length doesn't push us off the end of the buffer.  Found via
xfs/388 writing ones to the length fields.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/libxfs/xfs_dir2_data.c