public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Nick Bowler <nbowler@draconx.ca>
Cc: linux-xfs@vger.kernel.org, Brian Foster <bfoster@redhat.com>,
	Dave Chinner <david@fromorbit.com>
Subject: Re: [RFC PATCH v2 2/3] xfs: Fix bulkstat compat ioctls on x32 userspace.
Date: Mon, 17 Dec 2018 12:09:06 -0800	[thread overview]
Message-ID: <20181217200906.GA27176@magnolia> (raw)
In-Reply-To: <CADyTPEwwbKq2KCcRU=Rj+66JKPemq+BhNRitR-uz_gu=fXp-Ng@mail.gmail.com>

On Mon, Dec 17, 2018 at 03:06:43PM -0500, Nick Bowler wrote:
> On 2018-12-17 Darrick J. Wong <darrick.wong@oracle.com> wrote:
> > On Fri, Dec 14, 2018 at 08:22:58PM -0500, Nick Bowler wrote:
> [...]
> >> diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c
> >> index 4c34efcbf7e8..1cdc75dca779 100644
> >> --- a/fs/xfs/xfs_ioctl32.c
> >> +++ b/fs/xfs/xfs_ioctl32.c
> >> @@ -241,6 +241,32 @@ xfs_compat_ioc_bulkstat(
> >>  	int			done;
> >>  	int			error;
> >>
> >> +	/*
> >> +	 * Output structure handling functions.  Depending on the command,
> >> +	 * either the xfs_bstat and xfs_inogrp structures are written out
> >> +	 * to userpace memory via bulkreq.ubuffer.  Normally the compat
> >> +	 * functions and structure size are the correct ones to use ...
> >> +	 */
> >> +	inumbers_fmt_pf inumbers_func = xfs_inumbers_fmt_compat;
> >> +	bulkstat_one_pf	bs_one_func = xfs_bulkstat_one_compat;
> >> +	size_t bs_one_size = sizeof(compat_xfs_bstat_t);
> >> +
> >> +#ifdef CONFIG_X86_X32
> >> +	if (in_x32_syscall()) {
> >> +		/*
> >> +		 * ... but on x32 the input xfs_fsop_bulkreq has pointers
> >> +		 * which must be handled in the "compat" (32-bit) way, while
> >> +		 * the xfs_bstat and xfs_inogrp structures follow native 64-
> >> +		 * bit layout convention.  So adjust accordingly, otherwise
> >> +		 * the data written out in compat layout will not match what
> >> +		 * x32 userspace expects.
> >> +		 */
> >> +		inumbers_func = xfs_inumbers_fmt;
> >> +		bs_one_func = xfs_bulkstat_one;
> >> +		bs_one_size = sizeof(xfs_bstat_t);
> >
> > struct xfs_bstat, not xfs_bstat_t, because we're gradually getting rid
> > of the structure typedefs.  If I don't hear any other objections in the
> > next day or so I'll fix this when I pull in this patch.
> 
> Makes sense.  I'll only change this on my end if I have to respin the
> series for some other reason then.  I guess the sizeof(compat_xfs_bstat_t)
> just before this should be similarly changed as well?

Yep.

--D

> > Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Thanks,
>   Nick

  reply	other threads:[~2018-12-17 20:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15  1:22 [RFC PATCH v2 0/3] Fixing xfs ioctls on x32 Nick Bowler
2018-12-15  1:22 ` [RFC PATCH v2 1/3] xfs: Align compat attrlist_by_handle with native implementation Nick Bowler
2018-12-17 17:34   ` Darrick J. Wong
2018-12-15  1:22 ` [RFC PATCH v2 2/3] xfs: Fix bulkstat compat ioctls on x32 userspace Nick Bowler
2018-12-17 17:40   ` Darrick J. Wong
2018-12-17 20:06     ` Nick Bowler
2018-12-17 20:09       ` Darrick J. Wong [this message]
2018-12-15  1:22 ` [RFC PATCH v2 3/3] xfs: Fix x32 ioctls when cmd numbers differ from ia32 Nick Bowler
2018-12-17 18:18   ` Darrick J. Wong
2018-12-18  1:24 ` [RFC PATCH v2 0/3] Fixing xfs ioctls on x32 Nick Bowler

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=20181217200906.GA27176@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=nbowler@draconx.ca \
    /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