From owner-svn-src-stable@freebsd.org Tue Mar 27 17:51:46 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82CD8F6FE43; Tue, 27 Mar 2018 17:51:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FE3975C16; Tue, 27 Mar 2018 17:51:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A9431F607; Tue, 27 Mar 2018 17:51:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RHpkjL072898; Tue, 27 Mar 2018 17:51:46 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RHpjLB072893; Tue, 27 Mar 2018 17:51:45 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803271751.w2RHpjLB072893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 27 Mar 2018 17:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331636 - in stable/11/sys: dev/aac dev/aacraid modules/aac modules/aacraid sys X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11/sys: dev/aac dev/aacraid modules/aac modules/aacraid sys X-SVN-Commit-Revision: 331636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Mar 2018 17:51:46 -0000 Author: brooks Date: Tue Mar 27 17:51:45 2018 New Revision: 331636 URL: https://svnweb.freebsd.org/changeset/base/331636 Log: MFC r330949: Fix FSACTL_GET_NEXT_ADAPTER_FIB under 32-bit compat. This includes FSACTL_LNX_GET_NEXT_ADAPTER_FIB. Reviewed by: cem Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14672 Modified: stable/11/sys/dev/aac/aac.c stable/11/sys/dev/aacraid/aacraid.c stable/11/sys/modules/aac/Makefile stable/11/sys/modules/aacraid/Makefile stable/11/sys/sys/aac_ioctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/aac/aac.c ============================================================================== --- stable/11/sys/dev/aac/aac.c Tue Mar 27 17:48:39 2018 (r331635) +++ stable/11/sys/dev/aac/aac.c Tue Mar 27 17:51:45 2018 (r331636) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #define AAC_DRIVERNAME "aac" #include "opt_aac.h" +#include "opt_compat.h" /* #include */ #include @@ -45,7 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -3522,7 +3525,19 @@ aac_getnext_aif(struct aac_softc *sc, caddr_t arg) fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - if ((error = copyin(arg, &agf, sizeof(agf))) == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + struct get_adapter_fib_ioctl32 agf32; + error = copyin(arg, &agf32, sizeof(agf32)); + if (error == 0) { + agf.AdapterFibContext = agf32.AdapterFibContext; + agf.Wait = agf32.Wait; + agf.AifFib = (caddr_t)(uintptr_t)agf32.AifFib; + } + } else +#endif + error = copyin(arg, &agf, sizeof(agf)); + if (error == 0) { for (ctx = sc->fibctx; ctx; ctx = ctx->next) { if (agf.AdapterFibContext == ctx->unique) break; Modified: stable/11/sys/dev/aacraid/aacraid.c ============================================================================== --- stable/11/sys/dev/aacraid/aacraid.c Tue Mar 27 17:48:39 2018 (r331635) +++ stable/11/sys/dev/aacraid/aacraid.c Tue Mar 27 17:51:45 2018 (r331636) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #define AAC_DRIVERNAME "aacraid" #include "opt_aacraid.h" +#include "opt_compat.h" /* #include */ #include @@ -46,7 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -3382,7 +3385,19 @@ aac_getnext_aif(struct aac_softc *sc, caddr_t arg) fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); mtx_lock(&sc->aac_io_lock); - if ((error = copyin(arg, &agf, sizeof(agf))) == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + struct get_adapter_fib_ioctl32 agf32; + error = copyin(arg, &agf32, sizeof(agf32)); + if (error == 0) { + agf.AdapterFibContext = agf32.AdapterFibContext; + agf.Wait = agf32.Wait; + agf.AifFib = (caddr_t)(uintptr_t)agf32.AifFib; + } + } else +#endif + error = copyin(arg, &agf, sizeof(agf)); + if (error == 0) { for (ctx = sc->fibctx; ctx; ctx = ctx->next) { if (agf.AdapterFibContext == ctx->unique) break; Modified: stable/11/sys/modules/aac/Makefile ============================================================================== --- stable/11/sys/modules/aac/Makefile Tue Mar 27 17:48:39 2018 (r331635) +++ stable/11/sys/modules/aac/Makefile Tue Mar 27 17:51:45 2018 (r331636) @@ -8,7 +8,7 @@ SUBDIR= aac_linux KMOD= aac SRCS= aac.c aac_pci.c aac_disk.c aac_cam.c -SRCS+= opt_scsi.h opt_cam.h opt_aac.h +SRCS+= opt_scsi.h opt_cam.h opt_compat.h opt_aac.h SRCS+= device_if.h bus_if.h pci_if.h # To enable debug output from the driver, uncomment these two lines. Modified: stable/11/sys/modules/aacraid/Makefile ============================================================================== --- stable/11/sys/modules/aacraid/Makefile Tue Mar 27 17:48:39 2018 (r331635) +++ stable/11/sys/modules/aacraid/Makefile Tue Mar 27 17:51:45 2018 (r331636) @@ -8,7 +8,7 @@ SUBDIR= aacraid_linux KMOD= aacraid SRCS= aacraid.c aacraid_pci.c aacraid_cam.c -SRCS+= opt_scsi.h opt_cam.h opt_aacraid.h +SRCS+= opt_scsi.h opt_cam.h opt_compat.h opt_aacraid.h SRCS+= device_if.h bus_if.h pci_if.h # To enable debug output from the driver, uncomment these two lines. Modified: stable/11/sys/sys/aac_ioctl.h ============================================================================== --- stable/11/sys/sys/aac_ioctl.h Tue Mar 27 17:48:39 2018 (r331635) +++ stable/11/sys/sys/aac_ioctl.h Tue Mar 27 17:51:45 2018 (r331636) @@ -175,6 +175,14 @@ struct get_adapter_fib_ioctl { caddr_t AifFib; }; +#ifdef _KERNEL +struct get_adapter_fib_ioctl32 { + u_int32_t AdapterFibContext; + int Wait; + u_int32_t AifFib; +}; +#endif + struct aac_query_disk { int32_t ContainerNumber; int32_t Bus;