From: David Laight <david.laight.linux@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Reid Downing <skibletz@gmail.com>,
Carlos Maiolino <cem@kernel.org>,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
"Darrick J . Wong" <djwong@kernel.org>,
Eric Sandeen <sandeen@redhat.com>, Christoph Hellwig <hch@lst.de>,
stable@vger.kernel.org
Subject: Re: [PATCH v2] xfs: fix wrong compat fields in xfs_ioctl32_bstat_copyin()
Date: Wed, 28 Oct 2026 18:38:30 +0000 [thread overview]
Message-ID: <20261028183831.055627aa@pumpkin> (raw)
In-Reply-To: <auISUBmIMQr7fesW@infradead.org>
On Wed, 28 Oct 2026 08:18:40 -0700
Christoph Hellwig <hch@infradead.org> wrote:
> 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@gmail.com> 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,
That is a massive hit.
The current code also has all the conditionals from access_ok().
> but the scoped uaccess thing would do the same.
True, but unnecessarily 'technical' for this bit of code.
You also save all the exception table entries - so the code size
would be rather smaller.
David
next prev parent reply other threads:[~2026-10-28 18:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 16:17 Reid Downing
2026-10-27 16:49 ` David Laight
2026-10-28 15:18 ` Christoph Hellwig
2026-10-28 18:38 ` David Laight [this message]
2026-10-28 11:31 ` Reid Downing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261028183831.055627aa@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=skibletz@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®