diff options
author | 2017-03-15 00:24:25 -0700 | |
---|---|---|
committer | 2017-03-15 00:24:25 -0700 | |
commit | 630a04e79dd41ff746b545d4fc052e0abb836120 (patch) | |
tree | ef788a95dc530d80b012987a1dc60f9a3912abbe /fs/xfs/libxfs/xfs_dir2_priv.h | |
parent | xfs: try any AG when allocating the first btree block when reflinking (diff) | |
download | linux-630a04e79dd41ff746b545d4fc052e0abb836120.tar.gz linux-630a04e79dd41ff746b545d4fc052e0abb836120.tar.bz2 linux-630a04e79dd41ff746b545d4fc052e0abb836120.zip |
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.
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2_priv.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_priv.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_priv.h b/fs/xfs/libxfs/xfs_dir2_priv.h index d04547fcf274..eb00bc133bca 100644 --- a/fs/xfs/libxfs/xfs_dir2_priv.h +++ b/fs/xfs/libxfs/xfs_dir2_priv.h @@ -125,6 +125,8 @@ extern int xfs_dir2_sf_create(struct xfs_da_args *args, xfs_ino_t pino); extern int xfs_dir2_sf_lookup(struct xfs_da_args *args); extern int xfs_dir2_sf_removename(struct xfs_da_args *args); extern int xfs_dir2_sf_replace(struct xfs_da_args *args); +extern int xfs_dir2_sf_verify(struct xfs_mount *mp, struct xfs_dir2_sf_hdr *sfp, + int size); /* xfs_dir2_readdir.c */ extern int xfs_readdir(struct xfs_inode *dp, struct dir_context *ctx, |