aboutsummaryrefslogtreecommitdiffstats
path: root/tools/flask
Commit message (Collapse)AuthorAgeFilesLines
...
* tools: remove unnecessary uses of -I.Ian Campbell2011-03-211-1/+0
| | | | | | | | | | It's not needed unless you are including headers in the current directory _and_ you can't use "" instead of <> because the headers are to be installed. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: remove unnecessary uses of -L.Ian Campbell2011-03-212-2/+1
| | | | | | | | | It's not needed unless you are linking against a library in the current directory. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: Drop use of $(INCLUDES)Ian Campbell2011-03-211-1/+1
| | | | | | | | | | Several places include it in CFLAGS even though it is never defined. A few others use it as nothing more than a gathering point for CFLAGS. Get rid of it. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* build: Make XEN_ROOT an absolute path.Keir Fraser2011-03-173-3/+3
| | | | | | | | Otherwise make can search the path relative to certain standard paths such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in Config.mk suffers from this). Signed-off-by: Keir Fraser <keir@xen.org>
* xsm/flask: Fix permission tablesKeir Fraser2011-02-061-0/+2
| | | | | | | | | | | | | | | | | | At some point, it seems that someone manually added Flask permission definitions to one header file without updating the corresponding policy configuration or the other related table. The end result is that we can get uninterpretable AVC messages like this: # xl dmesg | grep avc (XEN) avc: denied { 0x4000000 } for domid=0 scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t tclass=domain Fix this by updating the flask config and regenerating the headers from it. In the future, this can be further improved by integrating the automatic generation of the headers into the build process as is presently done in SELinux. Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* split LDLIBS from LDFLAGS to fix link errors in recent toolchainsStefano Stabellini2010-08-112-3/+3
| | | | | | | | | | | | | | | | 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>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-285-48/+48
| | | | | | | | | | | | | | | | | | | | 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>
* Fix Makefile targets that generate several files at onceKeir Fraser2010-03-051-2/+4
| | | | | | | | | | | | | | | | | | | | In a few places in the tree the Makefiles have constructs like this: one_file another_file: $(COMMAND_WHICH_GENERATES_BOTH_AT_ONCE) This is wrong, because make will run _two copies_ of the same command at once. This generally causes races and hard-to-reproduce build failures. Notably, `make -j4' at the top level will build stubdom libxc twice simultaneously! In this patch we replace the occurrences of this construct with the correct idiom: one_file: another_file another_file: $(COMMAND_WHICH_GENERATES_BOTH_AT_ONCE) Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools/xsm: Expose Flask XSM AVC functions to user-spaceKeir Fraser2010-01-266-8/+175
| | | | | | | | | | | This patch exposes the flask_access, flask_avc_cachestats, flask_avc_hashstats, flask_getavc_threshold, flask_setavc_threshold, and flask_policyvers functions to user-space. A python wrapper was created for the flask_access function to facilitate policy based user-space access control decisions. flask.h was renamed to libflask.h to remove a naming conflict. Signed-off-by : Machon Gregory <mbgrego@tycho.ncsc.mil>
* xsm: Change format strings from signed to unsignedKeir Fraser2009-11-231-6/+6
| | | | | | ...to reflect the variables being passed in. Signed-off-by : Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
* xsm: Dynamic update to device ocontextsKeir Fraser2009-11-134-1/+255
| | | | | | | | | | | | | | Added the ability to add and delete ocontexts dynamically on a running system. Two new commands have been added to the xsm hypercall, add and delete ocontext. Twelve new library functions have been implemented that use the hypercall commands to label and unlabel pirqs, PCI devices, I/O ports and memory. The base policy has been updated so dom0 has the ability to use the hypercall commands by default. Items added to the list will not be present next time the system reloads. They will need to be added to the static policy. Signed-off-by : George Coker <gscoker@alpha.ncsc.mil> Signed-off-by : Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
* xsm: Add support for Xen device policiesKeir Fraser2009-10-273-1/+81
| | | | | | | | | | | | | Add support for Xen ocontext records to enable device polices. The default policy will not be changed and instructions have been added to enable the new functionality. Examples on how to use the new policy language have been added but commented out. The newest version of checkpolicy (>= 2.0.20) and libsepol (>= 2.0.39) is needed in order to compile it. Devices can be labeled and enforced using the following new commands; pirqcon, iomemcon, ioportcon and pcidevicecon. Signed-off-by : George Coker <gscoker@alpha.ncsc.mil> Signed-off-by : Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
* xsm: Add getenforce and setenforce functionality to toolsKeir Fraser2009-10-237-6/+183
| | | | | | | | This patch exposes the getenforce and setenforce functionality for the Flask XSM module. Signed-off-by : Machon Gregory <mbgrego@tycho.ncsc.mil> Signed-off-by : George S. Coker, II <gscoker@alpha.ncsc.mil>
* tools/flask/policy: Updates to policy and policy build infrastructureKeir Fraser2009-08-2012-1217/+342
| | | | | | | | | | | | | | | The original xen policy infrastructure was based off of an early version of refpolicy. Because of this there was a lot of cruft that does not apply to building a policy for xen. This patch does several things. First it cleans up the makefile as to remove many unnecessary build targets. Second it fixes an issue that the policy build process wasn't handling interface files properly. Third it pulls in the MLS suppport functions from current ref policy and makes use of them. Finally it updates the xen policy with new rules to address changes in xen since the policy was last worked on, and provides several new abstractions for creating domains. Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov>
* Update Xen Flask module to policy.24.Keir Fraser2009-08-191-1/+1
| | | | | | | | | | This is a back-port of the latest SELinux code to Xen, adjusted for Xen coding style and interfaces. Unneeded functionality such as most object context config data, handle_unknown, MLS field defaulting, etc has been omitted. Signed-off-by: Stephen D. Smalley <sds@tycho.nsa.gov> Signed-off-by: George S. Coker, II <gscoker@alpha.ncsc.mil>
* tools: clean up handling of xen config and scripts directories.Keir Fraser2009-05-191-1/+1
| | | | | | | 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>
* Use -MMD -MF in tools/* rather than -Wp,-M...Keir Fraser2009-01-122-6/+2
| | | | | | | | | | | | | | | | | | | | | | If you use -MMD -MF then the correct .o filename is written to the .*.d file as the compiler driver arranges everything. This was done in 19010:275abe1c5d24 for the hypervisor. In this patch we do the same elsewhere in the xen-unstable tree, particularly tools/. Specifically: * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS. * Remove -Wp,-MD... from every other Makefile * Remove setting of DEPS from every other Makefile * Ensure that every Makefile says -include $(DEPS) * Ensure that every Makefile's clean target removes $(DEPS) Some Makefiles were already halfway there, but often for a different variable name eg PROG_DEP. The variable name is now standardised in Rules.mk as DEPS. I have done a test build with this change, on Debian etch. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Add 2 more permissions to the XSM/Flask default policy.Keir Fraser2008-10-271-1/+2
| | | | Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
* flask: Add 2 permissions to the default flask policy to get a VIF-enabled ↵Keir Fraser2008-10-081-0/+3
| | | | | | | | | guest to work This adds two more permissions to the default Flask policy to get a VM with a network interface to work. Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
* flask: Fix to default policy to get simple VM runningKeir Fraser2008-10-081-1/+1
| | | | | | | This fix gets to the default Flask/XSM policy gets a simple guest VM (Ramdisk only, no VIF) running. Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
* xsm, flask: sample flask policyKeir Fraser2008-09-0421-0/+2291
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - The patch includes a policy for xen that can be booted into enforcing mode and supports creation and management of paravirtualized guests. The policy follows the dom0/domU usage model, extension to other models or the addition of management or IO permissions should be much more straightforward now. The option flask_enforcing=1 can be passed on the xen line in grub to boot into enforcing mode. - The policy provides a basic policy for booting the platform and creating a domU with the label system_u:object_r:domU_t. The policy can be easily extended to support new types by modifying the xen.te source file. - The policy includes some basic macros which may be helpful in extending the policy. - The policy is compatible with and requires the most recent XSM patch, xsm-flask-io-sysctl-hooks-090308.diff. - The policy is not built as part of the make all as it requires the SELinux policy compiler which may/may not be installed on all systems. Users must go into the tools/flask/policy directory and explicitly compile the policy. Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
* [XSM][FLASK] Argument handling bugs in XSM:FLASKKeir Fraser2008-07-212-6/+6
| | | | | | | | | | | | | | | | | | | Addresses a number of argument handling bugs in the flask_op hypercall in the XSM:Flask module. Thanks to Rafal Wojtczuk at McAfee for reporting the issues and Tim Deegan at Citrix for providing an initial patch. This patch addresses the following issues: - bounds checking and validation on input arguments to flask_op - updated ABI/API, size and cmd are now uint32_t - updated userspace tools and libraries to account for ABI/API changes - implemented all copies using from/to guest, better portability - implemented upper bounds checking on op->cmd, op->size - implemented sanity checking on op->size and op->buf - implemented bit vector for checking from/to usage on op->cmd Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
* tools/flask build: Use generic subdirs rules.Keir Fraser2008-03-251-18/+2
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Define CFLAGS and LDFLAGS for libxenctrl.Keir Fraser2008-01-271-3/+2
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Move generation of public header hierarchy into the tools.Keir Fraser2008-01-262-1/+2
| | | | | | | This patch merges the two versions of public header generation currently used in the build into one. Signed-off-by: Bastian Blank <waldi@debian.org>
* Add SBINDIR. Use it always.Keir Fraser2008-01-221-2/+2
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Add INCLUDEDIR. Use it.Keir Fraser2008-01-221-2/+2
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Apply PREFIX directly to LIBDIR.Keir Fraser2008-01-221-5/+5
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* tools: Remove bogus external uses of xc_private.h. Clean up libflask.Keir Fraser2007-10-185-83/+30
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix non-portabilities in libflask.Keir Fraser2007-10-023-8/+7
| | | | Signed-off-by: John Levon <john.levon@sun.com>
* Delete flask tools build target and add to .hgignore.kfraser@localhost.localdomain2007-09-061-0/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Xen Security Modules: ACM.kfraser@localhost.localdomain2007-08-311-0/+0
| | | | Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
* Xen Security Modules: Tools.kfraser@localhost.localdomain2007-08-316-0/+428
Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>