]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/xsm: Move {do,compat}_flask_op() declarations into a header
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 29 Oct 2021 22:05:25 +0000 (23:05 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Feb 2022 15:33:42 +0000 (15:33 +0000)
Declaring sideways like this is unsafe, because the compiler can't check that
the implementation in flask_op.c still has the same type.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>
xen/xsm/flask/flask_op.c
xen/xsm/flask/hooks.c
xen/xsm/flask/private.h [new file with mode: 0644]

index 221ff00fd3cc7ef66f473643991648e6c819cd2e..bb3bebc30e01df9cb0f5995119f0dd8482fd4764 100644 (file)
@@ -21,6 +21,7 @@
 #include <avc_ss.h>
 #include <objsec.h>
 #include <conditional.h>
+#include "private.h"
 
 #define ret_t long
 #define _copy_to_guest copy_to_guest
index 3b29f7fde372c72c1330b1f572bca0ae619cf71d..6ff1be28e4a41f83cdea4b0a889459f77a5e1ea1 100644 (file)
@@ -36,6 +36,7 @@
 #include <avc_ss.h>
 #include <objsec.h>
 #include <conditional.h>
+#include "private.h"
 
 static u32 domain_sid(const struct domain *dom)
 {
@@ -1742,9 +1743,6 @@ static int flask_argo_send(const struct domain *d, const struct domain *t)
 
 #endif
 
-long do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
-int compat_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
-
 static const struct xsm_ops __initconstrel flask_ops = {
     .security_domaininfo = flask_security_domaininfo,
     .domain_create = flask_domain_create,
diff --git a/xen/xsm/flask/private.h b/xen/xsm/flask/private.h
new file mode 100644 (file)
index 0000000..73b0de8
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef XSM_FLASK_PRIVATE
+#define XSM_FLASK_PRIVATE
+
+#include <public/xen.h>
+
+long do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
+int compat_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
+
+#endif /* XSM_FLASK_PRIVATE */