sysctl/XSM: drop .readconsole() hook

Integrate the checking with xsm_sysctl(), now that it has the full op
struct passed. As a positive side effect, permissions are then checked at
the same early point with and without Flask.

This is part of CVE-2026-62426 / XSA-499.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-By: Daniel P. Smith <dpsmith@apertussolutions.com>
This commit is contained in:
Jan Beulich authored and Andrew Cooper committed 2026-07-28 12:40:10 +01:00
1 parent 3179bf2931
commit 4b249cba4b
5 files changed
+6 -29

No files matched your search

-4
View File
@@ -59,10 +59,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
switch ( op->cmd )
{
case XEN_SYSCTL_readconsole:
ret = xsm_readconsole(XSM_HOOK, op->u.readconsole.clear);
if ( ret )
break;
ret = read_console_ring(&op->u.readconsole);
break;
-6
View File
@@ -181,12 +181,6 @@ static XSM_INLINE int cf_check xsm_sysctl(
return xsm_default_action(action, current->domain, NULL);
}
static XSM_INLINE int cf_check xsm_readconsole(XSM_DEFAULT_ARG uint32_t clear)
{
XSM_ASSERT_ACTION(XSM_HOOK);
return xsm_default_action(action, current->domain, NULL);
}
static XSM_INLINE int cf_check xsm_alloc_security_domain(struct domain *d)
{
return 0;
-6
View File
@@ -60,7 +60,6 @@ struct xsm_ops {
int (*domctl)(struct domain *d, struct xen_domctl *op);
#ifdef CONFIG_SYSCTL
int (*sysctl)(const struct xen_sysctl *op);
int (*readconsole)(uint32_t clear);
#endif
int (*evtchn_unbound)(struct domain *d, struct evtchn *chn, domid_t id2);
@@ -245,11 +244,6 @@ static inline int xsm_sysctl(xsm_default_t def, const struct xen_sysctl *op)
{
return alternative_call(xsm_ops.sysctl, op);
}
static inline int xsm_readconsole(xsm_default_t def, uint32_t clear)
{
return alternative_call(xsm_ops.readconsole, clear);
}
#endif
static inline int xsm_evtchn_unbound(
-1
View File
@@ -22,7 +22,6 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops = {
.domctl = xsm_domctl,
#ifdef CONFIG_SYSCTL
.sysctl = xsm_sysctl,
.readconsole = xsm_readconsole,
#endif
.evtchn_unbound = xsm_evtchn_unbound,
+6 -12
View File
@@ -877,13 +877,18 @@ static int cf_check flask_sysctl(const struct xen_sysctl *op)
switch ( op->cmd )
{
/* These have individual XSM hooks */
case XEN_SYSCTL_readconsole:
case XEN_SYSCTL_page_offline_op:
#ifdef CONFIG_X86
case XEN_SYSCTL_cpu_hotplug:
#endif
return 0;
case XEN_SYSCTL_readconsole:
return domain_has_xen(current->domain,
XEN__READCONSOLE |
(op->u.readconsole.clear ? XEN__CLEARCONSOLE
: 0));
case XEN_SYSCTL_tbuf_op:
return domain_has_xen(current->domain, XEN__TBUFCONTROL);
@@ -949,16 +954,6 @@ static int cf_check flask_sysctl(const struct xen_sysctl *op)
return avc_unknown_permission("sysctl", op->cmd);
}
}
static int cf_check flask_readconsole(uint32_t clear)
{
uint32_t perms = XEN__READCONSOLE;
if ( clear )
perms |= XEN__CLEARCONSOLE;
return domain_has_xen(current->domain, perms);
}
#endif /* CONFIG_SYSCTL */
static inline uint32_t resource_to_perm(uint8_t access)
@@ -1903,7 +1898,6 @@ static const struct xsm_ops __initconst_cf_clobber flask_ops = {
.domctl = flask_domctl,
#ifdef CONFIG_SYSCTL
.sysctl = flask_sysctl,
.readconsole = flask_readconsole,
#endif
.evtchn_unbound = flask_evtchn_unbound,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.