mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +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>
(cherry picked from commit 9f4aa6d00a)
This commit is contained in:
1 parent
c5578563ff
commit
59eefcbff2
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;
|
||||
|
||||
|
||||
@@ -178,7 +178,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);
|
||||
|
||||
@@ -60,7 +60,7 @@ struct xsm_ops {
|
||||
int (*sysctl_scheduler_op)(int op);
|
||||
int (*set_target)(struct domain *d, struct domain *e);
|
||||
int (*domctl)(struct domain *d, struct xen_domctl *op);
|
||||
int (*sysctl)(int cmd);
|
||||
int (*sysctl)(const struct xen_sysctl *op);
|
||||
int (*readconsole)(uint32_t clear);
|
||||
|
||||
int (*evtchn_unbound)(struct domain *d, struct evtchn *chn, domid_t id2);
|
||||
@@ -237,9 +237,9 @@ static inline int xsm_domctl(xsm_default_t def, struct domain *d,
|
||||
return alternative_call(xsm_ops.domctl, d, op);
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
@@ -889,9 +889,9 @@ static int cf_check flask_domctl(struct domain *d, struct xen_domctl *op)
|
||||
}
|
||||
}
|
||||
|
||||
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:
|
||||
@@ -963,7 +963,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||