From owner-svn-src-stable@freebsd.org Tue Mar 27 17:39:27 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 C62C4F6EAC4; Tue, 27 Mar 2018 17:39:27 +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 76E6C74744; Tue, 27 Mar 2018 17:39:27 +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 71ADD1F3E1; Tue, 27 Mar 2018 17:39:27 +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 w2RHdRXl065038; Tue, 27 Mar 2018 17:39:27 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RHdRt2065037; Tue, 27 Mar 2018 17:39:27 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803271739.w2RHdRt2065037@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:39:27 +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: r331631 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 331631 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:39:28 -0000 Author: brooks Date: Tue Mar 27 17:39:27 2018 New Revision: 331631 URL: https://svnweb.freebsd.org/changeset/base/331631 Log: MFC r330820: Reject ioctls to SCSI enclosures from 32-bit compat processes. The ioctl objects contain pointers and require translation and some refactoring of the infrastructure to work. For now prevent operation on garbage values. This is very slightly overbroad in that ENCIOC_INIT is safe. Reviewed by: imp, kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14671 Modified: stable/11/sys/cam/scsi/scsi_enc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc.c Tue Mar 27 17:37:08 2018 (r331630) +++ stable/11/sys/cam/scsi/scsi_enc.c Tue Mar 27 17:39:27 2018 (r331631) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include @@ -37,8 +39,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -351,6 +355,10 @@ enc_ioctl(struct cdev *dev, u_long cmd, caddr_t arg_ad void *addr; int error, i; +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) + return (ENOTTY); +#endif if (arg_addr) addr = *((caddr_t *) arg_addr);