APPLIED: [Bionic] xfs: map unwritten blocks in XFS_IOC_{ALLOC, FREE}SP just like fallocate
Stefan Bader
stefan.bader at canonical.com
Thu Jan 27 13:48:06 UTC 2022
On 20.01.22 15:31, Thadeu Lima de Souza Cascardo wrote:
> From: "Darrick J. Wong" <djwong at kernel.org>
>
> The old ALLOCSP/FREESP ioctls in XFS can be used to preallocate space at
> the end of files, just like fallocate and RESVSP. Make the behavior
> consistent with the other ioctls.
>
> Reported-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> Signed-off-by: Darrick J. Wong <djwong at kernel.org>
> Signed-off-by: Darrick J. Wong <darrick.wong at oracle.com>
> Reviewed-by: Dave Chinner <dchinner at redhat.com>
> Reviewed-by: Eric Sandeen <sandeen at redhat.com>
> (backported from commit 983d8e60f50806f90534cc5373d0ce867e5aaf79)
> [cascardo: always use XFS_BMAPI_PREALLOC on xfs_alloc_file_space]
> CVE-2021-4155
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at canonical.com>
> ---
Applied to bionic:linux/master-next. Thanks.
-Stefan
> fs/xfs/xfs_ioctl.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 2409b4ff4e07..6d3abb84451c 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -714,7 +714,8 @@ xfs_ioc_space(
> flags |= XFS_PREALLOC_CLEAR;
> if (bf->l_start > XFS_ISIZE(ip)) {
> error = xfs_alloc_file_space(ip, XFS_ISIZE(ip),
> - bf->l_start - XFS_ISIZE(ip), 0);
> + bf->l_start - XFS_ISIZE(ip),
> + XFS_BMAPI_PREALLOC);
> if (error)
> goto out_unlock;
> }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20220127/d61dfdf5/attachment.sig>
More information about the kernel-team
mailing list