Commit Graph
65 Commits
Author SHA1 Message Date
Stefano Stabellini ba26a1e197 split LDLIBS from LDFLAGS to fix link errors in recent toolchains
Linker command lines are order-sensitive.
Move linker options -Lfoo -lfoo from LDFLAGS to LDLIBS and place this new
variable after the objects to link. This resolves build errors in xenpagin
and blktap with recent toolchains.

rename SHLIB_CFLAGS to SHLIB_LDFLAGS
rename LDFLAGS_* to LDLIBS_*
move LDFLAGS usage after CFLAGS in CC calls
remove stale comments in xenpaging Makefile

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-08-11 18:02:32 +01:00
Keir Fraser 5cc436c1d2 libxc: eliminate static variables, use xentoollog; API change
This patch eliminate the global variables in libxenctrl (used for
logging and error reporting).

Instead the information which was in the global variables is now in a
new xc_interface* opaque structure, which xc_interface open returns
instead of the raw file descriptor; furthermore, logging is done via
xentoollog.

There are three new parameters to xc_interface_open to control the
logging, but existing callers can just pass "0" for all three to get
the old behaviour.

All libxc callers have been adjusted accordingly.

Also update QEMU_TAG for corresponding qemu change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-05-28 09:30:19 +01:00
Keir Fraser 94c3a1b680 tools: clean up handling of xen config and scripts directories.
For now hardcode /etc w/o a prefix as there are hardcoded
config paths in the code which would break otherwise.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-05-19 01:48:18 +01:00
Keir Fraser 727a00e80e Permit user to suppress passing --prefix to setup.py
We change all invocations of setup.py as follows:

* use $(PYTHON) instead of `python' so that the user can specify
  an alternative python version if they need to.  If not set it
  defaults to `python' in Config.mk.

* pass --prefix=$(PREFIX) via a new make variable
  $(PYTHON_PREFIX_ARG).  This allows a user to suppress the
  --prefix=... argument entirely by setting PYTHON_PREFIX_ARG=''.
  This will work around the bug described here
     https://bugs.launchpad.net/ubuntu/+bug/362570
  where passing --prefix=/usr/local (which ought to have no effect as
  /usr/local is the default prefix) changes which subdirectory
  distutils chooses, and results in the files being installed in
  site-packages which is not on the default search path.

  Users not affected by this python packaging bug should not set
  PYTHON_PREFIX_ARG and their builds will not be affected.  (Provided
  PREFIX did not contain spaces.  People who put spaces in PREFIX are
  being quite optimistic.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-05-07 19:32:10 +01:00
Keir Fraser 11e1149fe0 tools: Always use sane upstream (`native') python paths
Previously, by default we would install our python modules into
/usr/lib/python/xen, for example /usr/lib/python/xen/__init__.py.
Upstream python's standard install location (a) includes the Python
version number and (b) puts things in site-packages by default.

Our best conjecture for the reason for this was an attempt to make the
installs portable between different python versions.  However, that
doesn't work because compiled python modules (.pyc), and C python
extensions corresponding to one version of python, are not compatible
across different versions of python.

This is why upstream include the version number.

site-packages is the standard location for locally-installed packages
and is automatically included on the python search path.

In this change, we abandon our own unusual python path setup:

 * Invoke setup.py in an entirely standard manner.  We pass
   PREFIX and DESTDIR using the appropriate options provided by
   setup.py for those purposes (adding them to setup.py calls
   which were previously lacking them).

 * Since the installation locations are now on the standard
   python path, we no longer need to add anything to the path
   in any of our python utilities.  Therefore remove all that
   code from every python script.  (Many of these scripts
   unconditionally added /usr/lib/python and /usr/lib64/python which
   is wrong even in the old world.)

 * There is no longer any special `Xen python path'.  xen-python-path
   is no longer needed.  It is no longer called by anything in our
   tree.  However since out-of-tree callers may still invoke it, we
   retain it.  It now prints a fixed string referring to a directory
   which does not to exist; callers (who use it to augment their
   python path) will thus add a nonexistent directory to their python
   path which is harmless.

 * Remove various workarounds including use of setup.py --home
   (which is intended for something completely different).

 * Remove tests for the XEN_PYTHON_NATIVE_INSTALL build-time
   environment variable.  The new behaviour is the behaviour which we
   should have had if this variable had been set.  That is, it is now
   as if this variable was always set but also bugs in the resulting
   install have been fixed.

This should be a proper fix for the bug addressed by c/s 19515.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-04-08 19:13:04 +01:00
Keir Fraser 5b49c9af98 Remove dead file. Missed in previous changeset.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-04 13:00:26 +01:00
Keir Fraser 3fd29b158f acm: Modify the default ACM boot policy so that unlabeled domains can always start
I am modifying the xen- and xend-internal default policy so that
unlabeled domains can always start. A more restrictive security policy
can then be set on top of that policy.

Signed-off-by: Stefan Beger <stefanb@us.ibm.com>
2008-04-04 12:59:28 +01:00
Keir Fraser ad44c013ec Define CFLAGS and LDFLAGS for libxenctrl.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-01-27 12:57:14 +00:00
Keir Fraser 93e3de7b94 Add SBINDIR. Use it always.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-01-22 14:35:02 +00:00
Keir Fraser 53f48ca221 Fix some build system error handling.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2007-12-20 13:16:21 +00:00
Keir Fraser 4eb5685edc Implement legacy XML-RPC interface for ACM commands.
This patch moves the directory of files where xend is writing policies
and resource labels into to /var/lib/xend/security/policies.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-12-05 09:45:13 +00:00
Keir Fraser 0ea4d2fb34 Implement legacy XML-RPC interface for ACM commands.
This patch implements a (non Xen-API) legacy XML-RPC interface for the
ACM commands and funnels the calls into code introduced by the Xen-API
support for ACM security management. Since some of the functionality
has changed, also the xm applications have changed. In particular the
following old commands have been removed along with some tools the
have become obsolete now:

- loadpolicy    (included in: setpolicy)
- makepolicy    (included in: setpolicy)
- cfgbootpolicy (included in: setpolicy)

and the following commands been introduced:

- setpolicy
- getpolicy
- resetpolicy

All tools have been adapted to work in Xen-API and legacy XML-RPC
mode. Both modes support the same functionality.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-12-05 09:44:20 +00:00
Keir Fraser 8950f5c6ba Extend 'xm dumppolicy' to support Xen-API
I am extending 'xm dumppolicy' to be used via the Xen-API. For this
there are two new functions in the ACM policy class:
 - get the currently enforced policy including statistical data from
   the hypervisor
- get the ACM 'ssidref' of a Domain. Since this may be a ACM-specific
  variable or type (int) I put it into the ACM class.

I extended the Xen-API documentation with the two new functions.

Signed-off-by: Stefan Berger <Stefanb@us.ibm.com>
2007-10-03 14:04:51 +01:00
kfraser@localhost.localdomain 787dcb588b Check for libxml2 if security tools are to be built, and adapt the
python setup.py command line parameters to also work under SuSE.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-09-07 09:48:35 +01:00
kfraser@localhost.localdomain 61c6564d34 Cleanups after XSM checkin.
Signed-off-by: Keir Fraser <keir@xensource.com>

--HG--
rename : xen/include/public/acm.h => xen/include/public/xsm/acm.h
rename : xen/include/public/acm_ops.h => xen/include/public/xsm/acm_ops.h
rename : xen/include/acm/acm_core.h => xen/include/xsm/acm/acm_core.h
rename : xen/include/acm/acm_endian.h => xen/include/xsm/acm/acm_endian.h
rename : xen/include/acm/acm_hooks.h => xen/include/xsm/acm/acm_hooks.h
2007-08-31 12:05:07 +01:00
kfraser@localhost.localdomain e080ffba8d Fix/cleanup destroyDevice code path in xend.
When calling destroyDevice code path (e.g. xm block-detach dom devid),
allow specifying an integer device id or a device name such as xvdN or
/dev/xvdN.  Allowing the /dev/xvdN form is useful when detaching
devices from dom0.  Bootloaders may do this to unmount a disk
previously mounted in dom0.

Move examination of device ID format into the DevController,
permitting device controllers to determine a valid device ID instead
of higher level code.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-08-06 10:12:34 +01:00
kfraser@localhost.localdomain 883ff61657 [ACM] Support for removing / replacing a policy
Add support for removing/replacing a policy from the running
system. This operation is only successful if currently running VMs
would also be allowed to run under the new policy. Removing the
current policy means that the default policy is installed, which then
only has support for a single VM label and STE type (SystemManagement)
and is the same policy that the system starts up with when no policy
is chosen.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-08-06 10:11:25 +01:00
kfraser@localhost.localdomain b163ba1607 [ACM] Support for running unlabeled domains alongside labeled ones
Add support for running unlabeled domains alongside labeled ones, if
the policy contains a VM label with name '__UNLABELED__' and an STE
type with the same name. The ezpolicy tool has been modified to
automatically suggest a policy under which unlabeled domains can
run. The user may delete this, if this is not desired.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-08-06 10:10:34 +01:00
kfraser@localhost.localdomain 2b0134dd5a [ACM-security] Some fixes to tools.
- Allow multiple ChineseWallTypes in a VM labels
- check for surfacing exceptions in the python code
- check for array sizes in the XML DOM in python
- properly display the labels when doing 'xm list --label' in xm's
non-Xen-API mode
- rely on the security checking hooks in xend to check access to the
block interface rather than doing this in xm.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-12 16:07:28 +01:00
kfraser@localhost.localdomain 184e1b098b [Xen-API] Extension of the Xen-API for managing Xen Security Policies
This patch implements extensions for managing security policies in
xend. The XSPolicy and ACMPolicy classes provide the interface for the
Xen-API and implement functionality for setting, updating and
activating of a Xen security policy as well as labeling of virtual
machines and resources such as block devices. Labeling of network
devices will follow.

The acmpolicy class implements a compiler for translating an XML
policy into their binary format and provides functionality for
comparing a current policy against a new one when changing/updating a
policy.

The xspolicyadmin class administers the policy of the system.

Some of the xend-internal code deals with transforming the labeling
information from the S-Expression format into the new Xen-API
format. This is similar to much of the other code that is already
there.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-09 14:51:44 +01:00
kfraser@localhost.localdomain 5a6a960005 [ACM] Support for initial unicode handling of strings in policies.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-06 14:43:51 +01:00
kfraser@localhost.localdomain fab51b46ae [ACM] Simpler interface to hypercalls
Implement a simpler interface for the hypercalls to ACM. I put the
parameters to all hypercalls into a union. On top of this I have
implemented a shim layer for enabling ACM hypercalls on PPC.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-05-24 10:18:55 +01:00
kfraser@localhost.localdomain 8c706ec28d acm: Changes to XML schema of the policy
This patch changes the XML schema of the ACM policy to require a
version and that every conflict set have a name. Every VM label must
have one Chinese Wall Type and every resource label one Simple Type
Enforcement Type. As a consequence of this some example policies
needed to be changed. Also not offering that many configuration
options for compiling xen anymore to make things simpler.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-04-25 09:31:52 +01:00
Keir Fraser 856a272f35 [security] When building the binary policy align its contents the same way as the
ACM module does when returning its contents.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-04-19 19:29:19 +01:00
kfraser@localhost.localdomain 7f6d8fe5c9 acm: Provide the possibility to choose the VM label of domain-0 in the
kernel line in grub.conf. The format is
ssidref=<ssidref>:sHype:<policy name>:<vm label>. The name of the
policy specified here must be the same name as the in the policy
provided as a module during boot, otherwise the policy will not be
accepted and the system then starts without a policy. The user tool
for 'xm dumppolicy' has been adapted to show which entry in the binary
policy is used by domain-0.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-03-29 19:26:13 +01:00
kfraser@localhost.localdomain a10e171a41 [ACM] Allow version information to be embedded in the XML representation of
the ACM policy. The translation tool has been adapted to parse the
version found in the XML representation and put it into the binary
policy. Xen has been adapted to remember the version information and
report it when asked for the current policy.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-03-28 14:00:56 +01:00
Ewan Mellor 1bf63f099d This patch replaces tab with 4 whitespaces in xensec_gen/main.py.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-03-26 14:10:19 +01:00
kfraser@localhost.localdomain 9de4f0c67d tools: Clean up use of 'install' command.
- convert raw "install" command to use $(INSTALL)
- convert some $(INSTALL) to $(INSTALL_DATA) as appropriate
- modify the specific $(INSTALL) definitions to use -p.

Original patch by Ben Thomas <ben@virtualiron.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-03-07 10:49:20 +00:00
Christian Limpach b4dd69c689 [tools] Use auxbin.py to determine libpath at build time.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2007-03-05 19:22:21 +00:00
kfraser@localhost.localdomain 5c4256ca47 [ACM] Update the xensec_ezpolicy ACM policy generation tool so
that it works with wxPython under Python 2.5.
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2007-02-15 14:20:05 +00:00
Ian Campbell 8e84e3f524 [TOOLS] Fix foreign header build breakage.
Having both the Xen tree and the tools tree recurse into the foreign
headers directory causes headaches in parallel builds and when
building 32-bit tools + 64 bit Xen in the same tree.

Therefore we cause mk-symlinks to symlink in the foreign headers build
bits and generate a local version of the headers and checker tool.

Only libxc needs to do this since the other tools were actually
picking up the libxc version of the headers anyway so the mk-symlinks
calls can be removed from these components.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2007-01-31 10:25:12 +00:00
kfraser@localhost.localdomain 5ed80a6a52 [ACM] Documentation cleanup.
This patch eliminates redundant security tools information that was
integrated into the Xen user guide and the xm man page.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-10-20 10:48:34 +01:00
kfraser@localhost.localdomain 81ba8bb990 [ACM] Fix binary alignment in tools.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-10-18 17:29:08 +01:00
kfraser@localhost.localdomain 2f04c3f01e [ACM] Keep stream aligned.
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-10-18 17:17:15 +01:00
kaf24@localhost.localdomain b643712258 [XEND] Move all of the various log files created by xen to
be under /var/log/xen instead of under /var/log directly.  This has
the advantage of cleaning things up a little and also can make it
easier to restrict the permissions needed by xend.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-08-28 13:05:00 +01:00
kfraser@localhost.localdomain 33ac7e69c8 [ACM] A wxPython GUI tool for sHype/ACM in Xen. It is used
and described in the user guide to demonstrate how to quickly create, 
enforce, and test workload protection policies in Xen. The tool is aimed 
to improve usability of sHype/ACM for Xen.It is included in a single 
file to make it easy to try it out on different platforms (it inherits 
the look and feel of the base platform). It is tested on Linux and 
Windows. Please read the new user guide section about how to start and 
use the tool (section 10.2).

Requirements: python (www.python.org), wxPython (www.wxpython.org or
try 'yum install wxPython').

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-07-31 18:12:53 +01:00
kaf24@firebug.cl.cam.ac.uk ffa0b25d43 [ACM] Complete the conversion of acm_ops using Xen handles instead
of void pointers. It also fixes a recently slipped in acm bug that hangs 
Xen when a domain is destroyed.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-06-17 08:38:35 +01:00
kaf24@firebug.cl.cam.ac.uk df70dfb525 [ACM] Provide the framework needed for resource labeling.
Subsequent patches will follow in the coming weeks that will enable 
Xen ACM to control assignment of resources (e.g., block devices and 
networking) to virtual machines based on resource labels and the 
active security policy.

Signed-off-by: Bryan D. Payne <bdpayne@us.ibm.com>
Signed-off-by: Reiner Sailer <sailer@us.ibm.com>
2006-06-13 15:38:58 +01:00
kaf24@firebug.cl.cam.ac.uk 630ad4e0ad [ACM] Replace the union structure parameter of the ACM hypercalls
with command-specific request structures. It aligns the ACM
hypercalls with the way parameters are passed in the event channel
hypercalls.

Advantages include backward-compatibility regarding old guests when
new calls are added and clarity of the code.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-05-21 19:05:31 +01:00
kaf24@firebug.cl.cam.ac.uk 1d7579804b This small patch fixes new make-dependencies of the secpol_tool
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-05-10 15:49:47 +01:00
kaf24@firebug.cl.cam.ac.uk 2d0922d515 Move Linux-specific privcmd code into private libxc implementations.
Make header path for kernel's privcmd/evtchn headers generic.
Remove pointless xi_*() interface that was using private libxc
interfaces.

Signed-off-by: John Levon <john.levon@sun.com>
2006-05-02 15:12:06 +01:00
smh22@firebug.cl.cam.ac.uk 2c04b08df9 Add new xml files for policy.
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 11:01:41 +01:00
smh22@firebug.cl.cam.ac.uk 655ead6573 This patch updates the documentation and extends the 'xm' man page with
the integrated access control management commands. The man page is a 
good place to start exploring these commands.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:59:57 +01:00
smh22@firebug.cl.cam.ac.uk e7f4f3a1de This patch adds new python access control management scripts, which
integrate into Xen Management and which support the new access control 
labels (labels replace the ssidref numbers at the management user 
interface).

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:58:25 +01:00
smh22@firebug.cl.cam.ac.uk 2d59e34fc2 This patch deletes the old shell-based security tools.
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:54:47 +01:00
smh22@firebug.cl.cam.ac.uk 1f11fdecb1 This patch adds support for managing and creating the simplified
policies to the policy generation tools.

Signed-off by: Thomas Lendacky <toml@us.ibm.com>
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:52:19 +01:00
smh22@firebug.cl.cam.ac.uk 30476c8dba This patch adds support in the hypervisor for the policy name attribute
introduced into security policies. It also fixes a minor problem related 
to handling unsupported boot policies.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:51:50 +01:00
smh22@firebug.cl.cam.ac.uk c462e5c2f0 This patch adds a policy name to the policy definition. This policy name
must be unique and must change if the content of the file changes. The 
policy name is used to ensure that the XM tools and the hypervisor work 
on the same policy, i.e., interpret the security information on domains 
consistently. This patch also simplifies the policy management by moving 
policy and labels into a single file.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:50:38 +01:00
emellor@leeni.uk.xensource.com 6b884f9876 This fixes a path problem with the current ACM scripts.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-04-19 22:52:34 +01:00
kaf24@firebug.cl.cam.ac.uk b5fa90ac8e build: Clean up use of .PHONY
* Move .PHONY directives next to targets,
  this makes them a lot harder to miss
* Add missing .PHONY directives
* Remove nonexistent .PHONY directives
* Hopefully I didn'T miss anything...

Signed-Off-By: Horms <horms@verge.net.au>
2006-04-10 17:02:49 +01:00