diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2013-01-11 10:10:21 +0000 |
---|---|---|
committer | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2013-01-11 10:10:21 +0000 |
commit | 7a1db44b1246bcd320f932e65ae916158a04027a (patch) | |
tree | 083855c22964f68592b3e6d37d6d49c3ce2ab314 /xen/common/sysctl.c | |
parent | 996cf47b8081fc6b2efd4fa9a69f6b77028719e6 (diff) | |
download | xen-7a1db44b1246bcd320f932e65ae916158a04027a.tar.gz xen-7a1db44b1246bcd320f932e65ae916158a04027a.tar.bz2 xen-7a1db44b1246bcd320f932e65ae916158a04027a.zip |
xen: convert do_sysctl to use XSM
The xsm_sysctl hook now covers every sysctl, in addition to the more
fine-grained XSM hooks in most sub-functions.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/sysctl.c')
-rw-r--r-- | xen/common/sysctl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index 261b3c41de..61e7a2984a 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -34,15 +34,16 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl) struct xen_sysctl curop, *op = &curop; static DEFINE_SPINLOCK(sysctl_lock); - if ( !IS_PRIV(current->domain) ) - return -EPERM; - if ( copy_from_guest(op, u_sysctl, 1) ) return -EFAULT; if ( op->interface_version != XEN_SYSCTL_INTERFACE_VERSION ) return -EACCES; + ret = xsm_sysctl(op->cmd); + if ( ret ) + return ret; + /* * Trylock here avoids deadlock with an existing sysctl critical section * which might (for some current or future reason) want to synchronise |