diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 20b4c7af292820e116f4353ba4ef57a252f20ed2..bdebc21078d7e83bac4347ad13a5f569ed4d6a0f 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1723,6 +1723,12 @@ xfs_file_ioctl( struct xfs_fs_eofblocks eofb; struct xfs_eofblocks keofb; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + + if (mp->m_flags & XFS_MOUNT_RDONLY) + return -XFS_ERROR(EROFS); + if (copy_from_user(&eofb, arg, sizeof(eofb))) return -XFS_ERROR(EFAULT);