diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-06-04 10:23:54 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-06-04 18:25:05 -0700 |
commit | 2551a53053de52993be8752731f084fad3cfc4d8 (patch) | |
tree | 1956959bc2647d950a2ba4325ead3baa3271f7b8 /fs/xfs/xfs_attr_list.c | |
parent | 85ae01098c1a6a8e3ce908f8808f2d8f8effdbe3 (diff) |
xfs: explicitly pass buffer size to xfs_corruption_error
Explicitly pass the buffer length to xfs_corruption_error() instead of
assuming XFS_CORRUPTION_DUMP_LEN so that we avoid dumping off the end
of the buffer.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_attr_list.c')
-rw-r--r-- | fs/xfs/xfs_attr_list.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c index 3e59a348ea71..276465ed276e 100644 --- a/fs/xfs/xfs_attr_list.c +++ b/fs/xfs/xfs_attr_list.c @@ -139,7 +139,8 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context) ((char *)sfe >= ((char *)sf + dp->i_afp->if_bytes)))) { XFS_CORRUPTION_ERROR("xfs_attr_shortform_list", XFS_ERRLEVEL_LOW, - context->dp->i_mount, sfe); + context->dp->i_mount, sfe, + sizeof(*sfe)); kmem_free(sbuf); return -EFSCORRUPTED; } @@ -241,7 +242,7 @@ xfs_attr_node_list_lookup( if (magic != XFS_DA_NODE_MAGIC && magic != XFS_DA3_NODE_MAGIC) { XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, - node); + node, sizeof(*node)); goto out_corruptbuf; } |