From owner-svn-src-all@freebsd.org Fri May 17 18:25:55 2019 Return-Path: Delivered-To: svn-src-all@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 1EEE0159CDE9; Fri, 17 May 2019 18:25:55 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B83848743B; Fri, 17 May 2019 18:25:54 +0000 (UTC) (envelope-from stevek@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 9101DC287; Fri, 17 May 2019 18:25:54 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HIPsYc001968; Fri, 17 May 2019 18:25:54 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HIPsDJ001967; Fri, 17 May 2019 18:25:54 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905171825.x4HIPsDJ001967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 17 May 2019 18:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347941 - head/sys/dev/veriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/sys/dev/veriexec X-SVN-Commit-Revision: 347941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B83848743B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 May 2019 18:25:55 -0000 Author: stevek Date: Fri May 17 18:25:53 2019 New Revision: 347941 URL: https://svnweb.freebsd.org/changeset/base/347941 Log: Add command to get version of the ioctl interface for the veriexec device. Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/sys/dev/veriexec/veriexec_ioctl.h head/sys/dev/veriexec/verified_exec.c Modified: head/sys/dev/veriexec/veriexec_ioctl.h ============================================================================== --- head/sys/dev/veriexec/veriexec_ioctl.h Fri May 17 18:16:55 2019 (r347940) +++ head/sys/dev/veriexec/veriexec_ioctl.h Fri May 17 18:25:53 2019 (r347941) @@ -1,7 +1,7 @@ /* * $FreeBSD$ * - * Copyright (c) 2011-2013, 2015, Juniper Networks, Inc. + * Copyright (c) 2011-2013, 2015, 2019, Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,6 +54,7 @@ struct verified_exec_params { #define VERIEXEC_DEBUG_OFF _IO('S', 0x6) /* reset debug */ #define VERIEXEC_GETSTATE _IOR('S', 0x7, int) /* get state */ #define VERIEXEC_SIGNED_LOAD _IOW('S', 0x8, struct verified_exec_params) +#define VERIEXEC_GETVERSION _IOR('S', 0x9, int) /* get version */ #define _PATH_DEV_VERIEXEC _PATH_DEV "veriexec" Modified: head/sys/dev/veriexec/verified_exec.c ============================================================================== --- head/sys/dev/veriexec/verified_exec.c Fri May 17 18:16:55 2019 (r347940) +++ head/sys/dev/veriexec/verified_exec.c Fri May 17 18:25:53 2019 (r347941) @@ -138,6 +138,16 @@ verifiedexecioctl(struct cdev *dev __unused, u_long cm error = EINVAL; mtx_unlock(&ve_mutex); break; + case VERIEXEC_GETVERSION: + { + int *ip = (int *)data; + + if (ip) + *ip = MAC_VERIEXEC_VERSION; + else + error = EINVAL; + } + break; case VERIEXEC_LOCK: mtx_lock(&ve_mutex); mac_veriexec_set_state(VERIEXEC_STATE_LOCKED);