]> asedeno.scripts.mit.edu Git - linux.git/commit
xfs: Fix x32 ioctls when cmd numbers differ from ia32.
authorNick Bowler <nbowler@draconx.ca>
Mon, 17 Dec 2018 17:35:27 +0000 (09:35 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 18 Dec 2018 18:55:21 +0000 (10:55 -0800)
commita9d25bde1e9b24161dd798e1d23eb7eb9674012a
tree798d03905e89ad49e0a22c0ff7d2f9344983a2ff
parent7ca860e3c1a74ad6bd8949364073ef1044cad758
xfs: Fix x32 ioctls when cmd numbers differ from ia32.

Several ioctl structs change size between native 32-bit (ia32) and x32
applications, because x32 follows the native 64-bit (amd64) integer
alignment rules and uses 64-bit time_t.  In these instances, the ioctl
number changes so userspace simply gets -ENOTTY.  This scenario can be
handled by simply adding more cases.

Looking at the different ioctls implemented here:

- All the ones marked 'No size or alignment issue on any arch' should
  presumably all be fine.

- All the ones under BROKEN_X86_ALIGNMENT are different under integer
  alignment rules.  Since x32 matches amd64 here, we just need both
  sets of cases handled.

- XFS_IOC_SWAPEXT has both integer alignment differences and time_t
  differences.  Since x32 matches amd64 here, we need to add a case
  which calls the native implementation.

- The remaining ioctls have neither 64-bit integers nor time_t, so
  x32 matches ia32 here and no change is required at this level.  The
  bulkstat ioctl implementations have some pointer chasing which is
  handled separately.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_ioctl32.c