Re: [PATCH v2] xfs: fix wrong compat fields in xfs_ioctl32_bstat_copyin()

From: Christoph Hellwig

Date: Wed Oct 28 2026 - 11:18:52 EST


On Tue, Oct 27, 2026 at 04:49:11PM +0000, David Laight wrote:
> On Tue, 27 Oct 2026 12:17:48 -0400
> Reid Downing <skibletz@xxxxxxxxx> wrote:
>
> > bs_blocks and bs_xflags were both read from bstat32->bs_size.
> > Read each one from its own field instead.
>
> It would be much better to do a single copy_from_user() of the entire
> compat structure and copy the fields to the standard one.

Care to explain why it would be "much better" to do two copies instead of
one? The only benefits from copy_from/to_user over the current
get_put/user is avoidind the conctant user access disabling/enabling,
but the scoped uaccess thing would do the same.