Commit 3c2155b8 authored by Keir Fraser's avatar Keir Fraser

Remove unmaintained Access Control Module (ACM) from hypervisor.

Signed-off-by: default avatarKeir Fraser <keir@xen.org>
parent f40d30c4
......@@ -153,11 +153,9 @@ CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
# Enable XSM security module. Enabling XSM requires selection of an
# XSM security module (FLASK_ENABLE or ACM_SECURITY).
# Enable XSM security module (by default, Flask).
XSM_ENABLE ?= n
FLASK_ENABLE ?= n
ACM_SECURITY ?= n
FLASK_ENABLE ?= $(XSM_ENABLE)
# Download GIT repositories via HTTP or GIT's own protocol?
# GIT's protocol is faster and more robust, when it works at all (firewalls
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
......@@ -11,7 +11,6 @@ Xen XSM:FLASK configuration
XSM_ENABLE ?= y
FLASK_ENABLE ?= y
ACM_SECURITY ?= n
NB: Only one security module can be selected at a time. If no module is
selected, then the default DUMMY module will be enforced. The DUMMY module
......
......@@ -2177,47 +2177,6 @@ Most of the above are best understood by looking at the code
implementing them (in {\tt xen/common/dom0\_ops.c}) and in
the user-space tools that use them (mostly in {\tt tools/libxc}).
\section{Access Control Module Hypercalls}
\label{s:acmops}
Hypercalls relating to the management of the Access Control Module are
also restricted to domain 0 access for now. For more details on any or
all of these, please see {\tt xen/include/public/acm\_ops.h}. A
complete list is given below:
\begin{quote}
\hypercall{acm\_op(int cmd, void *args)}
This hypercall can be used to configure the state of the ACM, query
that state, request access control decisions and dump additional
information.
\begin{description}
\item [ACMOP\_SETPOLICY:] set the access control policy
\item [ACMOP\_GETPOLICY:] get the current access control policy and
status
\item [ACMOP\_DUMPSTATS:] get current access control hook invocation
statistics
\item [ACMOP\_GETSSID:] get security access control information for a
domain
\item [ACMOP\_GETDECISION:] get access decision based on the currently
enforced access control policy
\end{description}
\end{quote}
Most of the above are best understood by looking at the code
implementing them (in {\tt xen/common/acm\_ops.c}) and in the
user-space tools that use them (mostly in {\tt tools/security} and
{\tt tools/python/xen/lowlevel/acm}).
\section{Debugging Hypercalls}
A few additional hypercalls are mainly useful for debugging:
......
This diff is collapsed.
......@@ -13,7 +13,6 @@ SUBDIRS-y += hotplug
SUBDIRS-y += xentrace
SUBDIRS-$(CONFIG_XCUTILS) += xcutils
SUBDIRS-$(CONFIG_X86) += firmware
SUBDIRS-$(ACM_SECURITY) += security
SUBDIRS-y += console
SUBDIRS-y += xenmon
SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
......
......@@ -7,12 +7,12 @@ all install: check-build
# Check this machine is OK for building on.
.PHONY: check-build
check-build:
PYTHON=$(PYTHON) LIBXENAPI_BINDINGS=$(LIBXENAPI_BINDINGS) ACM_SECURITY=$(ACM_SECURITY) ./chk build
PYTHON=$(PYTHON) LIBXENAPI_BINDINGS=$(LIBXENAPI_BINDINGS) ./chk build
# Check this machine is OK for installing on.
.PHONY: check-install
check-install:
PYTHON=$(PYTHON) LIBXENAPI_BINDINGS=$(LIBXENAPI_BINDINGS) ACM_SECURITY=$(ACM_SECURITY) ./chk install
PYTHON=$(PYTHON) LIBXENAPI_BINDINGS=$(LIBXENAPI_BINDINGS) ./chk install
.PHONY: clean
clean:
......
......@@ -3,7 +3,7 @@
. ./funcs.sh
if [ ! "$LIBXENAPI_BINDINGS" = "y" -a ! "$ACM_SECURITY" = "y" ]
if [ ! "$LIBXENAPI_BINDINGS" = "y" ]
then
echo -n "unused, "
exit 0
......
......@@ -13,7 +13,6 @@ CTRL_SRCS-y += xc_domain.c
CTRL_SRCS-y += xc_evtchn.c
CTRL_SRCS-y += xc_gnttab.c
CTRL_SRCS-y += xc_misc.c
CTRL_SRCS-y += xc_acm.c
CTRL_SRCS-y += xc_flask.c
CTRL_SRCS-y += xc_physdev.c
CTRL_SRCS-y += xc_private.c
......
/******************************************************************************
* xc_acm.c
*
* Copyright (C) 2005, 2006 IBM Corporation, R Sailer
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "xc_private.h"
int xc_acm_op(xc_interface *xch, int cmd, void *arg, unsigned long arg_size)
{
int ret;
DECLARE_HYPERCALL;
DECLARE_HYPERCALL_BUFFER(struct xen_acmctl, acmctl);
acmctl = xc_hypercall_buffer_alloc(xch, acmctl, sizeof(*acmctl));
if ( acmctl == NULL )
{
PERROR("Could not allocate memory for ACM OP hypercall");
return -EFAULT;
}
switch (cmd) {
case ACMOP_setpolicy: {
struct acm_setpolicy *setpolicy = (struct acm_setpolicy *)arg;
memcpy(&acmctl->u.setpolicy,
setpolicy,
sizeof(struct acm_setpolicy));
}
break;
case ACMOP_getpolicy: {
struct acm_getpolicy *getpolicy = (struct acm_getpolicy *)arg;
memcpy(&acmctl->u.getpolicy,
getpolicy,
sizeof(struct acm_getpolicy));
}
break;
case ACMOP_dumpstats: {
struct acm_dumpstats *dumpstats = (struct acm_dumpstats *)arg;
memcpy(&acmctl->u.dumpstats,
dumpstats,
sizeof(struct acm_dumpstats));
}
break;
case ACMOP_getssid: {
struct acm_getssid *getssid = (struct acm_getssid *)arg;
memcpy(&acmctl->u.getssid,
getssid,
sizeof(struct acm_getssid));
}
break;
case ACMOP_getdecision: {
struct acm_getdecision *getdecision = (struct acm_getdecision *)arg;
memcpy(&acmctl->u.getdecision,
getdecision,
sizeof(struct acm_getdecision));
}
break;
case ACMOP_chgpolicy: {
struct acm_change_policy *change_policy = (struct acm_change_policy *)arg;
memcpy(&acmctl->u.change_policy,
change_policy,
sizeof(struct acm_change_policy));
}
break;
case ACMOP_relabeldoms: {
struct acm_relabel_doms *relabel_doms = (struct acm_relabel_doms *)arg;
memcpy(&acmctl->u.relabel_doms,
relabel_doms,
sizeof(struct acm_relabel_doms));
}
break;
}
acmctl->cmd = cmd;
acmctl->interface_version = ACM_INTERFACE_VERSION;
hypercall.op = __HYPERVISOR_xsm_op;
hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(acmctl);
if ( (ret = do_xen_hypercall(xch, &hypercall)) < 0)
{
if ( errno == EACCES )
DPRINTF("acmctl operation failed -- need to"
" rebuild the user-space tool set?\n");
}
switch (cmd) {
case ACMOP_getdecision: {
struct acm_getdecision *getdecision = (struct acm_getdecision *)arg;
memcpy(getdecision,
&acmctl->u.getdecision,
sizeof(struct acm_getdecision));
break;
}
}
xc_hypercall_buffer_free(xch, acmctl);
return ret;
}
/*
* Local variables:
* mode: C
* c-set-style: "BSD"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/
......@@ -44,8 +44,6 @@
#include <xen/memory.h>
#include <xen/grant_table.h>
#include <xen/hvm/params.h>
#include <xen/xsm/acm.h>
#include <xen/xsm/acm_ops.h>
#include <xen/xsm/flask_op.h>
#include <xen/tmem.h>
......@@ -1250,8 +1248,6 @@ int xc_sysctl(xc_interface *xch, struct xen_sysctl *sysctl);
int xc_version(xc_interface *xch, int cmd, void *arg);
int xc_acm_op(xc_interface *xch, int cmd, void *arg, unsigned long arg_size);
int xc_flask_op(xc_interface *xch, flask_op_t *op);
/*
......
/*
* Copyright (c) 2007, IBM Corp.
* Copyright (c) 2007, XenSource Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef XEN_ACMPOLICY_H
#define XEN_ACMPOLICY_H
#include "xen_common.h"
#include "xen_string_string_map.h"
#include "xen_xspolicy_decl.h"
#include "xen_vm_decl.h"
/*
* Data structures.
*/
typedef struct xen_acmpolicy_record
{
xen_xspolicy handle;
char *uuid;
char *repr;
xs_instantiationflags flags;
xs_type type;
} xen_acmpolicy_record;
/**
* Allocate a xen_acmpolicy_record.
*/
extern xen_acmpolicy_record *
xen_acmpolicy_record_alloc(void);
/**
* Free the given xen_xspolicy_record, and all referenced values. The
* given record must have been allocated by this library.
*/
extern void
xen_acmpolicy_record_free(xen_acmpolicy_record *record);
/**
* Data structures for the policy's header
*/
typedef struct xen_acm_header
{
char *policyname;
char *policyurl;
char *date;
char *reference;
char *namespaceurl;
char *version;
} xen_acm_header;
extern xen_acm_header *
xen_acm_header_alloc(void);
extern void
xen_acm_header_free(xen_acm_header *hdr);
/**
* Get the referenced policy's record.
*/
extern bool
xen_acmpolicy_get_record(xen_session *session, xen_acmpolicy_record **result,
xen_xspolicy xspolicy);
/**
* Get the header of a policy.
*/
extern bool
xen_acmpolicy_get_header(xen_session *session, xen_acm_header **hdr,
xen_xspolicy xspolicy);
/**
* Get the XML representation of the policy.
*/
extern bool
xen_acmpolicy_get_xml(xen_session *session, char **xml,
xen_xspolicy xspolicy);
/**
* Get the mapping file of the policy.
*/
extern bool
xen_acmpolicy_get_map(xen_session *session, char **map,
xen_xspolicy xspolicy);
/**
* Get the binary representation (base64-encoded) of the policy.
*/
extern bool
xen_acmpolicy_get_binary(xen_session *session, char **binary,
xen_xspolicy xspolicy);
/**
* Get the binary representation (base64-encoded) of the currently
* enforced policy.
*/
extern bool
xen_acmpolicy_get_enforced_binary(xen_session *session, char **binary,
xen_xspolicy xspolicy);
/**
* Get the ACM ssidref of the given VM.
*/
extern bool
xen_acmpolicy_get_VM_ssidref(xen_session *session, int64_t *result,
xen_vm vm);
/**
* Get the UUID field of the given policy.
*/
extern bool
xen_acmpolicy_get_uuid(xen_session *session, char **result,
xen_xspolicy xspolicy);
#endif
/*
* Copyright (c) 2007, IBM Corp.
* Copyright (c) 2007, XenSource Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stddef.h>
#include <stdlib.h>
#include "xen_internal.h"
#include "xen/api/xen_common.h"
#include "xen/api/xen_xspolicy.h"
#include "xen/api/xen_acmpolicy.h"
static const struct_member xen_acmpolicy_record_struct_members[] =
{
{ .key = "uuid",
.type = &abstract_type_string,
.offset = offsetof(xen_acmpolicy_record, uuid) },
{ .key = "flags",
.type = &abstract_type_int,
.offset = offsetof(xen_acmpolicy_record, flags) },
{ .key = "repr",
.type = &abstract_type_string,
.offset = offsetof(xen_acmpolicy_record, repr) },
{ .key = "type",
.type = &abstract_type_int,
.offset = offsetof(xen_acmpolicy_record, type) },
};
const abstract_type xen_acmpolicy_record_abstract_type_ =
{
.typename = STRUCT,
.struct_size = sizeof(xen_acmpolicy_record),
.member_count =
sizeof(xen_acmpolicy_record_struct_members) / sizeof(struct_member),
.members = xen_acmpolicy_record_struct_members
};
static const struct_member xen_acm_header_struct_members[] =
{
{ .key = "policyname",
.type = &abstract_type_string,
.offset = offsetof(xen_acm_header, policyname) },
{ .key = "policyurl",
.type = &abstract_type_string,
.offset = offsetof(xen_acm_header, policyurl) },
{ .key = "date",
.type = &abstract_type_string,
.offset = offsetof(xen_acm_header, date) },
{ .key = "reference",
.type = &abstract_type_string,
.offset = offsetof(xen_acm_header, reference) },
{ .key = "namespaceurl",
.type = &abstract_type_string,
.offset = offsetof(xen_acm_header, namespaceurl) },
{ .key = "version",
.type = &abstract_type_string,
.offset = offsetof(xen_acm_header, version) },
};
const abstract_type xen_acm_header_abstract_type_ =
{
.typename = STRUCT,
.struct_size = sizeof(xen_acm_header),
.member_count =
sizeof(xen_acm_header_struct_members) /
sizeof(struct_member),
.members = xen_acm_header_struct_members,
};
void
xen_acm_header_free(xen_acm_header *shdr)
{
if (shdr == NULL)
{
return;
}
free(shdr->policyname);
free(shdr->policyurl);
free(shdr->date);
free(shdr->reference);
free(shdr->namespaceurl);
free(shdr->version);
free(shdr);
}
void
xen_acmpolicy_record_free(xen_acmpolicy_record *record)
{
if (record == NULL)
{
return;
}
free(record->handle);
free(record->uuid);
free(record->repr);
free(record);
}
bool
xen_acmpolicy_get_record(xen_session *session, xen_acmpolicy_record **result,
xen_xspolicy xspolicy)
{
abstract_value param_values[] =
{
{ .type = &abstract_type_string,
.u.string_val = xspolicy }
};
abstract_type result_type = xen_acmpolicy_record_abstract_type_;
*result = NULL;
XEN_CALL_("ACMPolicy.get_record");
if (session->ok)
{
(*result)->handle = xen_strdup_((*result)->uuid);
}
return session->ok;
}
bool
xen_acmpolicy_get_header(xen_session *session,
xen_acm_header **result,
xen_xspolicy xspolicy)
{
abstract_value param_values[] =
{
{ .type = &abstract_type_string,
.u.string_val = xspolicy },
};
abstract_type result_type = xen_acm_header_abstract_type_;
*result = NULL;
XEN_CALL_("ACMPolicy.get_header");
return session->ok;
}
bool
xen_acmpolicy_get_xml(xen_session *session,
char **result,
xen_xspolicy xspolicy)
{
abstract_value param_values[] =
{
{ .type = &abstract_type_string,
.u.string_val = xspolicy },
};
abstract_type result_type = abstract_type_string;
*result = NULL;
XEN_CALL_("ACMPolicy.get_xml");
return session->ok;
}
bool
xen_acmpolicy_get_map(xen_session *session,
char **result,
xen_xspolicy xspolicy)
{
abstract_value param_values[] =
{
{ .type = &abstract_type_string,
.u.string_val = xspolicy },
};
abstract_type result_type = abstract_type_string;
*result = NULL;
XEN_CALL_("ACMPolicy.get_map");
return session->ok;
}
bool
xen_acmpolicy_get_binary(xen_session *session, char **result,
xen_xspolicy xspolicy)
{
abstract_value param_values[] =
{
{ .type = &abstract_type_string,
.u.string_val = xspolicy },
};
abstract_type result_type = abstract_type_string;
*result = NULL;
XEN_CALL_("ACMPolicy.get_binary");
return session->ok;
}
bool
xen_acmpolicy_get_enforced_binary(xen_session *session, char **result,
xen_xspolicy xspolicy)
{
abstract_value param_values[] =
{
{ .type = &abstract_type_string,
.u.string_val = xspolicy },
};
abstract_type result_type = abstract_type_string;
*result = NULL;
XEN_CALL_("ACMPolicy.get_enforced_binary");
return session->ok;
}
bool
xen_acmpolicy_get_VM_ssidref(xen_session *session,
int64_t *result, xen_vm vm)
{
abstract_value param_values[] =
{
{ .type = &abstract_type_string,
.u.string_val = vm }
};
abstract_type result_type = abstract_type_int;
XEN_CALL_("ACMPolicy.get_VM_ssidref");
return session->ok;
}
bool
xen_acmpolicy_get_uuid(xen_session *session, char **result,
xen_xspolicy xspolicy)
{
abstract_value param_values[] =
{
{ .type = &abstract_type_string,
.u.string_val = xspolicy }
};
abstract_type result_type = abstract_type_string;
*result = NULL;
XEN_CALL_("ACMPolicy.get_uuid");
return session->ok;
}
......@@ -43,14 +43,6 @@ process = Extension("process",
depends = [ ],
sources = [ "xen/lowlevel/process/process.c" ])
acm = Extension("acm",
extra_compile_args = extra_compile_args,
include_dirs = [ PATH_XEN, PATH_LIBXC, "xen/lowlevel/acm" ],
library_dirs = [ PATH_LIBXC ],
libraries = [ "xenctrl" ],
depends = [ PATH_LIBXC + "/libxenctrl.so" ],
sources = [ "xen/lowlevel/acm/acm.c" ])
flask = Extension("flask",
extra_compile_args = extra_compile_args,
include_dirs = [ PATH_XEN, PATH_LIBXC, "xen/lowlevel/flask",
......@@ -98,7 +90,7 @@ xl = Extension("xl",
sources = [ "xen/lowlevel/xl/xl.c", "xen/lowlevel/xl/_pyxl_types.c" ])
plat = os.uname()[0]
modules = [ xc, xs, ptsname, acm, flask, xl ]
modules = [ xc, xs, ptsname, flask, xl ]
if plat == 'SunOS':
modules.extend([ scf, process ])
if plat == 'Linux':
......@@ -113,7 +105,6 @@ setup(name = 'xen',
'xen.util.xsm',
'xen.util.xsm.dummy',
'xen.util.xsm.flask',
'xen.util.xsm.acm',
'xen.xend',
'xen.xend.server',
'xen.xend.xenstore',
......
This diff is collapsed.
......@@ -8,10 +8,11 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"