Skip to contentSkip to conversation

XSM denials with 4.7.0 RC1

DISCUSSION Doug Goldstein 5 participants 9 messages May 4, 2016

lore
Share & tools
lore
#0 lore raw

Hi all,

Sometime after d4cd5a205973171475b8c63bc250c2803e0f51fa, I get the following denials for any domU that attempts to run "xl". In my situation my domU needs to run "xl devd" because its a driver domain.

(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_compile_info } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_capabilities } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_changeset } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_pagesize } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_commandline } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_build_id } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

I'm guessing a changed happened to xl so that it queries the version info everytime it is run.

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw
Quoted 32 lines
Quoted 1 line
Quoted 1 line · On 04.05.16 at 15:52, <[email protected]> wrote:

Hi all,

Sometime after d4cd5a205973171475b8c63bc250c2803e0f51fa, I get the following denials for any domU that attempts to run "xl". In my situation my domU needs to run "xl devd" because its a driver domain.

(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_compile_info } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_capabilities } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_changeset } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_pagesize } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_commandline } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_build_id } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

Quoted 2 lines

I'm guessing a changed happened to xl so that it queries the version info everytime it is run.

Perhaps it did that always, and it has become a problem only because of the XSM check which the version hypercall obtained recently?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 32 lines · Jan Beulich
Quoted 32 lines
Quoted 1 line
Quoted 1 line · On 04.05.16 at 15:52, <[email protected]> wrote:

Hi all,

Sometime after d4cd5a205973171475b8c63bc250c2803e0f51fa, I get the following denials for any domU that attempts to run "xl". In my situation my domU needs to run "xl devd" because its a driver domain.

(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_compile_info } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_capabilities } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_changeset } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_pagesize } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_commandline } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_build_id } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

Quoted 9 lines
Quoted 2 lines

I'm guessing a changed happened to xl so that it queries the version info everytime it is run.

Perhaps it did that always, and it has become a problem only because of the XSM check which the version hypercall obtained recently?

Jan

That would do it as well, thank you. I knew there was a change in this code path recently and I remembered Konrad was active in it so I CC'd him.

If no one else proposes a change I'll look at making a patch tomorrow.

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
In reply to Doug Goldstein

CC Konrad and Ross

Quoted 31 lines · Doug Goldstein

Hi all,

Sometime after d4cd5a205973171475b8c63bc250c2803e0f51fa, I get the following denials for any domU that attempts to run "xl". In my situation my domU needs to run "xl devd" because its a driver domain.

(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_compile_info } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_capabilities } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_changeset } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_pagesize } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_commandline } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_build_id } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

Quoted 3 lines

I'm guessing a changed happened to xl so that it queries the version info everytime it is run.

I think the root cause is that we have now altered xen_version hypercall for xsplice.

We might need to update the hook, the default policy (assuming that's what you use) or both.

Wei.

Quoted 11 lines
Signature · 10 lines
Doug Goldstein





_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 38 lines · Wei Liu

CC Konrad and Ross

Quoted 31 lines · Doug Goldstein

Hi all,

Sometime after d4cd5a205973171475b8c63bc250c2803e0f51fa, I get the following denials for any domU that attempts to run "xl". In my situation my domU needs to run "xl devd" because its a driver domain.

(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_compile_info } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_capabilities } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_changeset } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_pagesize } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_commandline } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_build_id } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

Quoted 3 lines

I'm guessing a changed happened to xl so that it queries the version info everytime it is run.

Quoted 5 lines

I think the root cause is that we have now altered xen_version hypercall for xsplice.

We might need to update the hook, the default policy (assuming that's what you use) or both.

The policy:
# For normal guests all possible except XENVER_commandline. allow domain_type xen_t:version {
xen_extraversion xen_compile_info xen_capabilities xen_changeset xen_pagesize xen_guest_handle
};

So not sure why you are seeing those. Did you rebuild your policy against 4.7.0-1rc?

The xen_build_id and xen_commandline should definitly error out per:

a2fc8d514df2b38c310d4f4432fe06520b0769ed

Author: Konrad Rzeszutek Wilk <[email protected]>
Date:   Fri Mar 11 21:40:43 2016 -0500

xsm/xen_version: Add XSM for most of xen_version hypercall

The subop for XENVER_commandline is now a priviliged operation. To not break guests we still return an string - but it is just '<denied>\0'.

And the XSM checks would trigger for XENVER_commandline - it just that instead of -EPERM being returned we return '<denied>\0'.

Is that not the case?

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
In reply to Doug Goldstein
Quoted 16 lines · Doug Goldstein

Hi all,

Sometime after d4cd5a205973171475b8c63bc250c2803e0f51fa, I get the following denials for any domU that attempts to run "xl". In my situation my domU needs to run "xl devd" because its a driver domain.

(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_compile_info } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_capabilities } for domid=1

Quoted 8 lines

scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_changeset } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_pagesize } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

These 6 denials should not happen with the policy in 4.7.0-rc1; are you using an older policy?

Quoted 6 lines

(XEN) avc: denied { xen_commandline } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_build_id } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

If these show up for domUs in normal operation (and I think using "xl devd" probably qualifies for that), then they probably need dontaudit rules.

Signature · 7 lines
Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#6 lore raw
Quoted 26 lines · Daniel De Graaf
Quoted 16 lines · Doug Goldstein

Hi all,

Sometime after d4cd5a205973171475b8c63bc250c2803e0f51fa, I get the following denials for any domU that attempts to run "xl". In my situation my domU needs to run "xl devd" because its a driver domain.

(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_extraversion } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_compile_info } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_capabilities } for domid=1

Quoted 8 lines

scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_changeset } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_pagesize } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

Quoted 2 lines

These 6 denials should not happen with the policy in 4.7.0-rc1; are you using an older policy?

Well it turns out yes I was using a bad policy. I grabbed the policy updates from master and not from 4.7.0-rc1 when I merged them with my policy. So yes the above are incorrect and noise on my part. master wasn't (and still isn't) at the same point that 4.7.0-rc1 was at.

Quoted 8 lines
Quoted 7 lines

(XEN) avc: denied { xen_commandline } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_build_id } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

Quoted 4 lines

If these show up for domUs in normal operation (and I think using "xl devd" probably qualifies for that), then they probably need dontaudit rules.

These are still happening for any domD running "xl devd".

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#7 lore raw
Quoted 14 lines

Well it turns out yes I was using a bad policy. I grabbed the policy updates from master and not from 4.7.0-rc1 when I merged them with my policy. So yes the above are incorrect and noise on my part. master wasn't (and still isn't) at the same point that 4.7.0-rc1 was at.

Quoted 8 lines
Quoted 7 lines

(XEN) avc: denied { xen_commandline } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_build_id } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

Quoted 6 lines
Quoted 4 lines

If these show up for domUs in normal operation (and I think using "xl devd" probably qualifies for that), then they probably need dontaudit rules.

These are still happening for any domD running "xl devd".

Is 'domD' not part of domain_type?

As in the policy has:

allow domain_type xen_t:version {
xen_extraversion xen_compile_info xen_capabilities xen_changeset xen_pagesize xen_guest_handle
};

Is domD under a different type? In which case it sounds as if you are using a non-default XSM policy?

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#8 lore raw
Quoted 25 lines · Konrad Rzeszutek Wilk
Quoted 14 lines

Well it turns out yes I was using a bad policy. I grabbed the policy updates from master and not from 4.7.0-rc1 when I merged them with my policy. So yes the above are incorrect and noise on my part. master wasn't (and still isn't) at the same point that 4.7.0-rc1 was at.

Quoted 8 lines
Quoted 7 lines

(XEN) avc: denied { xen_commandline } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version
(XEN) avc: denied { xen_build_id } for domid=1 scontext=system_u:system_r:domU_t tcontext=system_u:system_r:xen_t tclass=version

Quoted 6 lines
Quoted 4 lines

If these show up for domUs in normal operation (and I think using "xl devd" probably qualifies for that), then they probably need dontaudit rules.

These are still happening for any domD running "xl devd".

Is 'domD' not part of domain_type?

As in the policy has:

Quoted 8 lines

allow domain_type xen_t:version {
xen_extraversion xen_compile_info xen_capabilities xen_changeset xen_pagesize xen_guest_handle
};

Is domD under a different type? In which case it sounds as if you are using a non-default XSM policy?

I'm calling it domD (since I'm passing a device into it) but its a domU. Ignore my wording. I've got a few extra allows at the bottom of the default policy to allow a PCI device to be passed in.

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel