Project

General

Profile

Bug #9260

nsmb driver 32-bit ioctl check broken after 8685

Added by Gordon Ross over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
2018-03-10
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

The nsmb driver uses ioctl data structures that have been carefully designed to to have layouts that are invariant between 32-bit and 64-bit user-level callers.
This avoids any need for the in-kernel copyin/copyout code in nsmb to deal with converting 32-bit ioctl structures to 64-bit (in-kernel) versions.

There is some build-time machinery to verify that ioctl structure layout invariance. See:
http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/intel/nsmb/Makefile
http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/intel/nsmb/ioc_check.ref
http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/fs/smbclnt/netsmb/offsets.in

Now that we only build kernel components 64-bit, that Makefile needs work
so it can create the 32-bit ioc_check.h and compare it with the reference.
Probably can (mostly) copy usr/src/uts/sparc/nsmb/Makefile
which already deals with this situation.

History

#1

Updated by Gordon Ross over 1 year ago

  • Description updated (diff)
#2

Updated by Electric Monk over 1 year ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit bbbed746ed07daa0e18f08cf6145bb3f2b063f24

commit  bbbed746ed07daa0e18f08cf6145bb3f2b063f24
Author: Gordon Ross <gwr@nexenta.com>
Date:   2018-03-14T18:52:14.000Z

    9260 nsmb driver 32-bit ioctl check broken after 8685
    Reviewed by: Igor Kozhukhov <igor@dilos.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Joshua M. Clulow <josh@sysmgr.org>

#3

Updated by Gordon Ross over 1 year ago

Notes about the fix:

Revert changes in usr/src/uts/Makefile.\{targ,uts\}
Let uts/intel/Makefile.intel define \{ALL,DEF\}\_BUILDS for 32-bit only,
Also the platform makefiles: uts/i86pc/Makefile.\* etc.
(Similar to how sparc handled that.)

Add logic to intel/nsmb/Makefile like sparc had to run just the
necessary part of the 32-bit build for the ioctl check.

Also available in: Atom PDF