xfs: verify inline directory data forks
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 15 Mar 2017 07:24:25 +0000 (00:24 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 15 Mar 2017 07:24:25 +0000 (00:24 -0700)
commit630a04e79dd41ff746b545d4fc052e0abb836120
treeef788a95dc530d80b012987a1dc60f9a3912abbe
parent2fcc319d2467a5f5b78f35f79fd6e22741a31b1e
xfs: verify inline directory data forks

When we're reading or writing the data fork of an inline directory,
check the contents to make sure we're not overflowing buffers or eating
garbage data.  xfs/348 corrupts an inline symlink into an inline
directory, triggering a buffer overflow bug.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
---
v2: add more checks consistent with _dir2_sf_check and make the verifier
usable from anywhere.
fs/xfs/libxfs/xfs_dir2_priv.h
fs/xfs/libxfs/xfs_dir2_sf.c
fs/xfs/libxfs/xfs_inode_fork.c
fs/xfs/libxfs/xfs_inode_fork.h
fs/xfs/xfs_dir2_readdir.c
fs/xfs/xfs_inode.c