Skip to content

Commit 31d9497

Browse files
committed
Merge tag 'xfs-5.17-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull more xfs irix ioctl housecleaning from Darrick Wong: "Withdraw the XFS_IOC_ALLOCSP* and XFS_IOC_FREESP* ioctl definitions. This is the third and final of a series of small pull requests that perform some long overdue housecleaning of XFS ioctls. This time, we're withdrawing all variants of the ALLOCSP and FREESP ioctls from XFS' userspace API. This might be a little premature since we've only just removed the functionality, but as I pointed out in the last pull request, nobody (including fstests) noticed that it was broken for 20 years. In response to the patch, we received a single comment from someone who stated that they 'augment' the ioctl for their own purposes, but otherwise acquiesced to the withdrawal. I still want to try to clobber these old ioctl definitions in 5.17. So remove the header definitions for these ioctls. The just-removed implementation has allowed callers to read stale disk contents for more than **21 years** and nobody noticed or complained, which implies a lack of users aside from exploit programs" * tag 'xfs-5.17-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: remove the XFS_IOC_{ALLOC,FREE}SP* definitions
2 parents d701a8c + b3bb941 commit 31d9497

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

fs/xfs/libxfs/xfs_fs.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -760,13 +760,13 @@ struct xfs_scrub_metadata {
760760
* For 'documentation' purposed more than anything else,
761761
* the "cmd #" field reflects the IRIX fcntl number.
762762
*/
763-
#define XFS_IOC_ALLOCSP _IOW ('X', 10, struct xfs_flock64)
764-
#define XFS_IOC_FREESP _IOW ('X', 11, struct xfs_flock64)
763+
/* XFS_IOC_ALLOCSP ------- deprecated 10 */
764+
/* XFS_IOC_FREESP -------- deprecated 11 */
765765
#define XFS_IOC_DIOINFO _IOR ('X', 30, struct dioattr)
766766
#define XFS_IOC_FSGETXATTR FS_IOC_FSGETXATTR
767767
#define XFS_IOC_FSSETXATTR FS_IOC_FSSETXATTR
768-
#define XFS_IOC_ALLOCSP64 _IOW ('X', 36, struct xfs_flock64)
769-
#define XFS_IOC_FREESP64 _IOW ('X', 37, struct xfs_flock64)
768+
/* XFS_IOC_ALLOCSP64 ----- deprecated 36 */
769+
/* XFS_IOC_FREESP64 ------ deprecated 37 */
770770
#define XFS_IOC_GETBMAP _IOWR('X', 38, struct getbmap)
771771
/* XFS_IOC_FSSETDM ------- deprecated 39 */
772772
#define XFS_IOC_RESVSP _IOW ('X', 40, struct xfs_flock64)

fs/xfs/xfs_ioctl.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,6 +1854,15 @@ xfs_fs_eofblocks_from_user(
18541854
return 0;
18551855
}
18561856

1857+
/*
1858+
* These long-unused ioctls were removed from the official ioctl API in 5.17,
1859+
* but retain these definitions so that we can log warnings about them.
1860+
*/
1861+
#define XFS_IOC_ALLOCSP _IOW ('X', 10, struct xfs_flock64)
1862+
#define XFS_IOC_FREESP _IOW ('X', 11, struct xfs_flock64)
1863+
#define XFS_IOC_ALLOCSP64 _IOW ('X', 36, struct xfs_flock64)
1864+
#define XFS_IOC_FREESP64 _IOW ('X', 37, struct xfs_flock64)
1865+
18571866
/*
18581867
* Note: some of the ioctl's return positive numbers as a
18591868
* byte count indicating success, such as readlink_by_handle.

fs/xfs/xfs_ioctl32.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,6 @@ typedef struct compat_xfs_flock64 {
154154
__s32 l_pad[4]; /* reserve area */
155155
} compat_xfs_flock64_t;
156156

157-
#define XFS_IOC_ALLOCSP_32 _IOW('X', 10, struct compat_xfs_flock64)
158-
#define XFS_IOC_FREESP_32 _IOW('X', 11, struct compat_xfs_flock64)
159-
#define XFS_IOC_ALLOCSP64_32 _IOW('X', 36, struct compat_xfs_flock64)
160-
#define XFS_IOC_FREESP64_32 _IOW('X', 37, struct compat_xfs_flock64)
161157
#define XFS_IOC_RESVSP_32 _IOW('X', 40, struct compat_xfs_flock64)
162158
#define XFS_IOC_UNRESVSP_32 _IOW('X', 41, struct compat_xfs_flock64)
163159
#define XFS_IOC_RESVSP64_32 _IOW('X', 42, struct compat_xfs_flock64)

0 commit comments

Comments
 (0)