[GIT PULL] xfs: legacy Irix ioctl housecleaning for 5.17-rc1, part 1

From: Darrick J. Wong
Date: Thu Jan 20 2022 - 13:46:02 EST


Hi Linus,

This is the second of a series of small pull requests that perform some
long overdue housecleaning of XFS ioctls. This time, we're vacating the
implementation of all variants of the ALLOCSP and FREESP ioctls, which
are holdovers from EFS in Irix, circa 1993. Roughly equivalent
functionality have been available for both ioctls since 2.6.25 (April
2008):

XFS_IOC_FREESP ftruncates a file.

XFS_IOC_ALLOCSP is the equivalent of fallocate.

As noted in the fix patch for CVE 2021-4155, the ALLOCSP ioctl has been
serving up stale disk blocks since 2000, and in 21 years **nobody**
noticed. On those grounds I think it's safe to vacate the
implementation.

Note that we lose the ability to preallocate and truncate relative to
the current file position, but as nobody's ever implemented that for the
VFS, I conclude that it's not in high demand.

As usual, I did a test-merge with upstream master as of a few minutes
ago. There's a single merge conflict due to the fixpatch that we merged
right before 5.16 that can be resolved by deleting the function. Please
let me know if you encounter any problems.

--D

The following changes since commit 9dec0368b9640c09ef5af48214e097245e57a204:

xfs: remove the XFS_IOC_FSSETDM definitions (2022-01-17 09:16:40 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git tags/xfs-5.17-merge-5

for you to fetch changes up to 4d1b97f9ce7c0d2af2bb85b12d48e6902172a28e:

xfs: kill the XFS_IOC_{ALLOC,FREE}SP* ioctls (2022-01-17 09:16:41 -0800)

----------------------------------------------------------------
Remove the XFS_IOC_ALLOCSP* and XFS_IOC_FREESP* ioctl families.

Linux has always used fallocate as the space management system call,
whereas these Irix legacy ioctls only ever worked on XFS, and have been
the cause of recent stale data disclosure vulnerabilities. As
equivalent functionality is available elsewhere, remove the code.

----------------------------------------------------------------
Darrick J. Wong (1):
xfs: kill the XFS_IOC_{ALLOC,FREE}SP* ioctls

fs/xfs/xfs_bmap_util.c | 7 ++--
fs/xfs/xfs_bmap_util.h | 2 +-
fs/xfs/xfs_file.c | 3 +-
fs/xfs/xfs_ioctl.c | 92 +++-----------------------------------------------
fs/xfs/xfs_ioctl.h | 6 ----
fs/xfs/xfs_ioctl32.c | 27 ---------------
6 files changed, 10 insertions(+), 127 deletions(-)