From owner-svn-src-stable@freebsd.org Tue Mar 27 17:43:04 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 4CA71F6F1A9; Tue, 27 Mar 2018 17:43:04 +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 EE05D74FA9; Tue, 27 Mar 2018 17:43:03 +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 E8D9D1F587; Tue, 27 Mar 2018 17:43:03 +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 w2RHh3ie070122; Tue, 27 Mar 2018 17:43:03 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RHh3NC070121; Tue, 27 Mar 2018 17:43:03 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803271743.w2RHh3NC070121@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:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r331633 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/sys/cam/scsi X-SVN-Commit-Revision: 331633 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:43:04 -0000 Author: brooks Date: Tue Mar 27 17:43:03 2018 New Revision: 331633 URL: https://svnweb.freebsd.org/changeset/base/331633 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 opertion 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/10/sys/cam/scsi/scsi_enc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_enc.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_enc.c Tue Mar 27 17:42:04 2018 (r331632) +++ stable/10/sys/cam/scsi/scsi_enc.c Tue Mar 27 17:43:03 2018 (r331633) @@ -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);