Re: [PATCH] xfs: fix bs_xflags copied from wrong compat field

From: Darrick J. Wong

Date: Fri Oct 16 2026 - 01:09:00 EST


On Thu, Oct 15, 2026 at 10:11:57PM -0400, Reid D wrote:
> From: Reid Downing (b1nv0id) <skibletz@xxxxxxxxx>
> Subject: [PATCH] xfs: fix bs_xflags copied from wrong compat field
>
> Read bs_xflags from the correct compat field in
> xfs_ioctl32_bstat_copyin().
>
> Signed-off-by: Reid Downing (b1nv0id) <skibletz@xxxxxxxxx>

Yikes. Good thing we don't actually /use/ bs_xflags in swapext.

Cc: <stable@xxxxxxxxxxxxxxx> # v2.6.29
Fixes: e94fc4a43e5c39 ("[XFS] Add compat handlers for swapext ioctl")
Reviewed-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>

--D

> ---
> fs/xfs/xfs_ioctl32.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/fs/xfs/xfs_ioctl32.c
> +++ b/fs/xfs/xfs_ioctl32.c
> @@ -124,7 +124,7 @@
> xfs_ioctl32_bstime_copyin(&bstat->bs_mtime, &bstat32->bs_mtime) ||
> xfs_ioctl32_bstime_copyin(&bstat->bs_ctime, &bstat32->bs_ctime) ||
> get_user(bstat->bs_blocks, &bstat32->bs_size) ||
> - get_user(bstat->bs_xflags, &bstat32->bs_size) ||
> + get_user(bstat->bs_xflags, &bstat32->bs_xflags) ||
> get_user(bstat->bs_extsize, &bstat32->bs_extsize) ||
> get_user(bstat->bs_extents, &bstat32->bs_extents) ||
> get_user(bstat->bs_gen, &bstat32->bs_gen) ||
>