diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-06-21 04:53:28 +0300 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-06-21 04:53:28 +0300 |
commit | 128f24d5d9def3c47b6b659b2454f0426a347144 (patch) | |
tree | d710ea5064f2301990475e8f6081e9e8313aaa74 /fs/xfs/xfs_error.c | |
parent | 479c641273df632478cda7fe76b833df64e319bc (diff) | |
download | linux-128f24d5d9def3c47b6b659b2454f0426a347144.tar.xz |
xfs: check for a valid error_tag in errortag_add
Currently we don't check the error_tag when someone's trying to set up
error injection testing. If userspace passes in a value we don't know
about, send back an error. This will help xfstests to _notrun a test
that uses error injection to test things like log replay.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_error.c')
-rw-r--r-- | fs/xfs/xfs_error.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c index 88693a98fac5..355619ae5e3e 100644 --- a/fs/xfs/xfs_error.c +++ b/fs/xfs/xfs_error.c @@ -61,6 +61,9 @@ xfs_errortag_add(int error_tag, xfs_mount_t *mp) int len; int64_t fsid; + if (error_tag >= XFS_ERRTAG_MAX) + return -EINVAL; + memcpy(&fsid, mp->m_fixedfsid, sizeof(xfs_fsid_t)); for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) { |