xsm: correct AVC lookups for two sysctls

The current code was incorrectly using SECCLASS_XEN instead of
SECCLASS_XEN2, resulting in the wrong permission being checked.

GET_CPU_LEVELLING_CAPS was checking MTRR_DEL
GET_CPU_FEATURESET was checking MTRR_READ

The default XSM policy only allowed these permissions to dom0, so this
didn't result in a security issue there.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Daniel De Graaf authored and Jan Beulich committed 2017-08-10 12:35:28 +02:00
1 parent 80eb3da01b
commit de834631b6
1 file changed
+4 -2
+4 -2
View File
@@ -814,10 +814,12 @@ static int flask_sysctl(int cmd)
return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
case XEN_SYSCTL_get_cpu_levelling_caps:
return domain_has_xen(current->domain, XEN2__GET_CPU_LEVELLING_CAPS);
return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
XEN2__GET_CPU_LEVELLING_CAPS);
case XEN_SYSCTL_get_cpu_featureset:
return domain_has_xen(current->domain, XEN2__GET_CPU_FEATURESET);
return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
XEN2__GET_CPU_FEATURESET);
case XEN_SYSCTL_livepatch_op:
return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
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.