summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_acl.h
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2018-10-06 11:44:39 +1000
committerDave Chinner <david@fromorbit.com>2018-10-06 11:44:39 +1000
commitb39989009bdb84992915c9869f58094ed5becf10 (patch)
tree574f76831c2cd648c830512c18dabba768ac96eb /fs/xfs/xfs_acl.h
parentdceeb47b0ed65e14de53507a8a9c32a90831cfa1 (diff)
downloadlinux-stable-b39989009bdb84992915c9869f58094ed5becf10.tar.gz
linux-stable-b39989009bdb84992915c9869f58094ed5becf10.tar.bz2
linux-stable-b39989009bdb84992915c9869f58094ed5becf10.zip
xfs: fix data corruption w/ unaligned reflink ranges
When reflinking sub-file ranges, a data corruption can occur when the source file range includes a partial EOF block. This shares the unknown data beyond EOF into the second file at a position inside EOF, exposing stale data in the second file. XFS only supports whole block sharing, but we still need to support whole file reflink correctly. Hence if the reflink request includes the last block of the souce file, only proceed with the reflink operation if it lands at or past the destination file's current EOF. If it lands within the destination file EOF, reject the entire request with -EINVAL and make the caller go the hard way. This avoids the data corruption vector, but also avoids disruption of returning EINVAL to userspace for the common case of whole file cloning. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_acl.h')
0 files changed, 0 insertions, 0 deletions