mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
sysctl/XSM: pass full struct xen_sysctl to xsm_sysctl()
Subsequently some sub-ops will want to inspect their sub-sub-ops. This is part of CVE-2026-62426 / XSA-499. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
This commit is contained in:
1 parent
4ef45cbe31
commit
9f4aa6d00a
4 files changed
+9
-8
No files matched your search
+1
-1
@@ -42,7 +42,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
|
||||
if ( op->interface_version != XEN_SYSCTL_INTERFACE_VERSION )
|
||||
return -EACCES;
|
||||
|
||||
ret = xsm_sysctl(XSM_PRIV, op->cmd);
|
||||
ret = xsm_sysctl(XSM_PRIV, op);
|
||||
if ( ret )
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -180,7 +180,8 @@ static XSM_INLINE int cf_check xsm_domctl(
|
||||
}
|
||||
}
|
||||
|
||||
static XSM_INLINE int cf_check xsm_sysctl(XSM_DEFAULT_ARG int cmd)
|
||||
static XSM_INLINE int cf_check xsm_sysctl(
|
||||
XSM_DEFAULT_ARG const struct xen_sysctl *op)
|
||||
{
|
||||
XSM_ASSERT_ACTION(XSM_PRIV);
|
||||
return xsm_default_action(action, current->domain, NULL);
|
||||
|
||||
@@ -62,7 +62,7 @@ struct xsm_ops {
|
||||
int (*set_target)(struct domain *d, struct domain *e);
|
||||
int (*domctl)(struct domain *d, struct xen_domctl *op);
|
||||
#ifdef CONFIG_SYSCTL
|
||||
int (*sysctl)(int cmd);
|
||||
int (*sysctl)(const struct xen_sysctl *op);
|
||||
int (*readconsole)(uint32_t clear);
|
||||
#endif
|
||||
|
||||
@@ -251,9 +251,9 @@ static inline int xsm_domctl(xsm_default_t def, struct domain *d,
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static inline int xsm_sysctl(xsm_default_t def, int cmd)
|
||||
static inline int xsm_sysctl(xsm_default_t def, const struct xen_sysctl *op)
|
||||
{
|
||||
return alternative_call(xsm_ops.sysctl, cmd);
|
||||
return alternative_call(xsm_ops.sysctl, op);
|
||||
}
|
||||
|
||||
static inline int xsm_readconsole(xsm_default_t def, uint32_t clear)
|
||||
|
||||
@@ -872,9 +872,9 @@ static int cf_check flask_domctl(struct domain *d, struct xen_domctl *op)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static int cf_check flask_sysctl(int cmd)
|
||||
static int cf_check flask_sysctl(const struct xen_sysctl *op)
|
||||
{
|
||||
switch ( cmd )
|
||||
switch ( op->cmd )
|
||||
{
|
||||
/* These have individual XSM hooks */
|
||||
case XEN_SYSCTL_readconsole:
|
||||
@@ -942,7 +942,7 @@ static int cf_check flask_sysctl(int cmd)
|
||||
XEN2__COVERAGE_OP, NULL);
|
||||
|
||||
default:
|
||||
return avc_unknown_permission("sysctl", cmd);
|
||||
return avc_unknown_permission("sysctl", op->cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||