Bug 1484908 - xenconsole does not start
Summary: xenconsole does not start
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-24 14:00 UTC by Konrad Rzeszutek Wilk
Modified: 2019-11-13 02:18 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-20 11:17:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
search -m avc -ts recent" under F26 (4.56 KB, text/x-vhdl)
2017-09-05 12:59 UTC, Konrad Rzeszutek Wilk
no flags Details

Description Konrad Rzeszutek Wilk 2017-08-24 14:00:48 UTC
Description of problem:

systemctl list shows xenconsoled as having issues

xenconsoled.service - Xenconsoled - handles logging from guest consoles and hypervisor
   Loaded: loaded (/usr/lib/systemd/system/xenconsoled.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2017-08-24 09:34:32 EDT; 5min ago
  Process: 836 ExecStart=/usr/sbin/xenconsoled -i --log=${XENCONSOLED_TRACE} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS (code=exited, status=1/FAILURE)
  Process: 835 ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR} (code=exited, status=0/SUCCESS)
  Process: 834 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities (code=exited, status=0/SUCCESS)
 Main PID: 836 (code=exited, status=1/FAILURE)

How reproducible:

100%

Steps to Reproduce:
1. Install rawhide (I did Fedora-Server-dvd-x86_64-Rawhide-20170811.n.2.iso)
2. yum install xen
3. Reboot

Actual results:

xenconsoled.service - Xenconsoled - handles logging from guest consoles and hypervisor
   Loaded: loaded (/usr/lib/systemd/system/xenconsoled.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2017-08-24 09:34:32 EDT; 5min ago
  Process: 836 ExecStart=/usr/sbin/xenconsoled -i --log=${XENCONSOLED_TRACE} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS (code=exited, status=1/FAILURE)
  Process: 835 ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR} (code=exited, status=0/SUCCESS)
  Process: 834 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities (code=exited, status=0/SUCCESS)
 Main PID: 836 (code=exited, status=1/FAILURE)

Expected results:

No failures on it.
Additional info:

]# systemctl restart xenconsoled.service 
[root@tst063 ~]# systemctl status xenconsoled.service 
● xenconsoled.service - Xenconsoled - handles logging from guest consoles and hypervisor
   Loaded: loaded (/usr/lib/systemd/system/xenconsoled.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2017-08-24 09:41:11 EDT; 7s ago
  Process: 12302 ExecStart=/usr/sbin/xenconsoled -i --log=${XENCONSOLED_TRACE} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS (code=exited, status=1/FAILURE)
  Process: 12301 ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR} (code=exited, status=0/SUCCESS)
  Process: 12300 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities (code=exited, status=0/SUCCESS)
 Main PID: 12302 (code=exited, status=1/FAILURE)

[root@tst063 ~]# more /usr/lib/systemd/system/xenconsoled.service
[Unit]
Description=Xenconsoled - handles logging from guest consoles and hypervisor
Requires=proc-xen.mount
After=proc-xen.mount xenstored.service oxenstored.service
ConditionPathExists=/proc/xen/capabilities

[Service]
Type=simple
Environment=XENCONSOLED_ARGS=
Environment=XENCONSOLED_TRACE=none
Environment=XENCONSOLED_LOG_DIR=/var/log/xen/console
EnvironmentFile=/etc/sysconfig/xencommons
ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR}
ExecStart=/usr/sbin/xenconsoled -i --log=${XENCONSOLED_TRACE} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS

[Install]
WantedBy=multi-user.target
[root@tst063 ~]# /usr/sbin/xenconsoled -i --log=none --log-dir=/var/log/xen/console^Z
[2]+  Stopped                 /usr/sbin/xenconsoled -i --log=none --log-dir=/var/log/xen/console
[root@tst063 ~]# bg
[2]+ /usr/sbin/xenconsoled -i --log=none --log-dir=/var/log/xen/console &
[root@tst063 ~]# ps -eff |grep xenc
root     12492  1143  0 09:47 pts/0    00:00:00 /usr/sbin/xenconsoled -i --log=none --log-dir=/var/log/xen/console


Looking in /var/log/audit/audit.log I see:

type=SERVICE_START msg=audit(1503582405.127:801): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=xenconsoled comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=AVC msg=audit(1503582405.129:802): avc:  denied  { map } for  pid=12465 comm="xenconsoled" path="/etc/ld.so.cache" dev="dm-1" ino=8618795 scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=file permissive=0
type=AVC msg=audit(1503582405.132:803): avc:  denied  { sys_resource } for  pid=12465 comm="xenconsoled" capability=24  scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:system_r:xenconsoled_t:s0 tclass=capability permissive=0
type=AVC msg=audit(1503582405.133:804): avc:  denied  { create } for  pid=12465 comm="xenconsoled" scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:system_r:xenconsoled_t:s0 tclass=unix_dgram_socket permissive=0
type=AVC msg=audit(1503582405.133:805): avc:  denied  { getattr } for  pid=12465 comm="xenconsoled" path="/run/xenstored/socket" dev="tmpfs" ino=24909 scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=0
type=AVC msg=audit(1503582405.133:806): avc:  denied  { getattr } for  pid=12465 comm="xenconsoled" path="/dev/xen/xenbus" dev="devtmpfs" ino=11314 scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=chr_file permissive=0
type=AVC msg=audit(1503582405.133:807): avc:  denied  { create } for  pid=12465 comm="xenconsoled" scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:system_r:xenconsoled_t:s0 tclass=unix_dgram_socket permissive=0
type=SERVICE_STOP msg=audit(1503582405.135:808): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=xenconsoled comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
[root@tst063 dracut]#

Comment 1 Michael Young 2017-08-24 14:07:30 UTC
Does it start if you enable selinux first, for example by running setenforce 0 ?

Comment 2 Konrad Rzeszutek Wilk 2017-08-24 14:39:01 UTC
(In reply to Michael Young from comment #1)
> Does it start if you enable selinux first, for example by running setenforce
> 0 ?

Yes:


[root@tst063 ~]# setenforce 0
[root@tst063 ~]# systemctl start  xenconsoled.service
[root@tst063 ~]# systemctl status  xenconsoled.service
● xenconsoled.service - Xenconsoled - handles logging from guest consoles and hypervisor
   Loaded: loaded (/usr/lib/systemd/system/xenconsoled.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-08-24 10:38:38 EDT; 5s ago
  Process: 2051 ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR} (code=exited, status=0/SUCCESS)
  Process: 2050 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities (code=exited, status=0/SUCCESS)
 Main PID: 2052 (xenconsoled)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/xenconsoled.service
           └─2052 /usr/sbin/xenconsoled -i --log=none --log-dir=/var/log/xen/console

Comment 3 Konrad Rzeszutek Wilk 2017-08-24 17:32:44 UTC
Just to confirm, when you said 'enable' you meant 'disable' - as setenforce 0 disables SELinux.

Comment 4 Konrad Rzeszutek Wilk 2017-08-30 00:27:49 UTC
Sooo ..what is the next step? Should this be re-assigned to selinux package?

Comment 5 Fedora Blocker Bugs Application 2017-09-04 11:59:14 UTC
Proposed as a Blocker for 27-final by Fedora user konradr using the blocker tracking app because:

 Fails QA:Testcase_Boot_Methods_Xen_Para_Virt

Comment 6 Adam Williamson 2017-09-04 17:25:59 UTC
Next step is, re-assign to selinux-policy-targeted , and include the details of the denials. Best way to do that is to run the test with SELinux in Permissive mode, then run:

ausearch -m avc -ts recent

that should find all the relevant denials and you can paste them into the bug...

Comment 7 Kamil Páral 2017-09-04 17:37:06 UTC
Discussed during blocker review [1]:

punt (delay decision) - it's not clear whether this actually violates the criterion, so we will request a more detailed explanation from Konrad

[1] https://meetbot-raw.fedoraproject.org/fedora-blocker-review/2017-09-04/

Konrad, can you please explain what exactly is broken here? What consequences does it have? Also, please look at https://fedoraproject.org/wiki/Fedora_27_Final_Release_Criteria#Xen_DomU and tell us whether you consider the criterion violated as currently written. Thanks.

Comment 8 Konrad Rzeszutek Wilk 2017-09-05 00:37:25 UTC
(In reply to Adam Williamson from comment #6)
> Next step is, re-assign to selinux-policy-targeted , and include the details
> of the denials. Best way to do that is to run the test with SELinux in
> Permissive mode, then run:
> 
> ausearch -m avc -ts recent
> 
> that should find all the relevant denials and you can paste them into the
> bug...

# ausearch -m avc -ts recent
----
time->Mon Sep  4 20:30:55 2017
type=AVC msg=audit(1504571455.230:108): avc:  denied  { map } for  pid=830 comm="abrt-dump-journ" path="/var/lib/sss/mc/passwd" dev="dm-1" ino=17742853 scontext=system_u:system_r:abrt_dump_oops_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file permissive=1
----
time->Mon Sep  4 20:30:55 2017
type=AVC msg=audit(1504571455.282:110): avc:  denied  { sys_resource } for  pid=831 comm="xenconsoled" capability=24  scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:system_r:xenconsoled_t:s0 tclass=capability permissive=1
----
time->Mon Sep  4 20:30:55 2017
type=AVC msg=audit(1504571455.282:111): avc:  denied  { getattr } for  pid=831 comm="xenconsoled" path="/run/xenstored/socket" dev="tmpfs" ino=24187 scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=1
----
time->Mon Sep  4 20:30:55 2017
type=AVC msg=audit(1504571455.282:112): avc:  denied  { write } for  pid=831 comm="xenconsoled" name="socket" dev="tmpfs" ino=24187 scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=1
----
time->Mon Sep  4 20:30:59 2017
type=AVC msg=audit(1504571459.025:136): avc:  denied  { remount } for  pid=917 comm="(ostnamed)" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:xenstored_var_lib_t:s0 tclass=filesystem permissive=1

Comment 9 Konrad Rzeszutek Wilk 2017-09-05 00:57:59 UTC
(In reply to Kamil Páral from comment #7)
> Discussed during blocker review [1]:
> 
> punt (delay decision) - it's not clear whether this actually violates the
> criterion, so we will request a more detailed explanation from Konrad
> 
> [1] https://meetbot-raw.fedoraproject.org/fedora-blocker-review/2017-09-04/
> 
> Konrad, can you please explain what exactly is broken here? What
> consequences does it have? Also, please look at
> https://fedoraproject.org/wiki/Fedora_27_Final_Release_Criteria#Xen_DomU and
> tell us whether you consider the criterion violated as currently written.
> Thanks.

Sure thing. The xenconsoled service is used to get console support for guests.

That is this runs inside of Xen dom0. And from reading the URLs (and the discussion from 2011) it does not hit the criteria (sorry about that, my memory was wrong). Removing the blocker part.

A bit of explanation - I had in mind the "..supported Xen Dom0", but that actually means: " ..  it needs to run with a previous release as Dom0" (as in Fedora Core 26). [https://lists.fedoraproject.org/pipermail/test/2011-October/103678.html]

Which seems really weird - as if this does not get fixed in F27 (as dom0), then F28 (guest) won't be able to run as guest anymore with the previous release of F27.

Comment 10 Konrad Rzeszutek Wilk 2017-09-05 01:01:42 UTC
...
> A bit of explanation - I had in mind the "..supported Xen Dom0", but that
> actually means: " ..  it needs to run with a previous release as Dom0" (as
> in Fedora Core 26).
> [https://lists.fedoraproject.org/pipermail/test/2011-October/103678.html]

Just to be sure: 

.. which would mean if I test the rawhide guests under F26 ("supported Xen Dom0") and there are issues booting rawhide guests (b/c of issues in F26) then it would still be a blocker against rawhide for the packages that have issues in F26 (if naturally the issues are also present in rawhide?).

Comment 11 Adam Williamson 2017-09-05 04:43:55 UTC
That's, uhh...hmm. A bit of a grey area. The basic point of the criterion was to block on domU functionality not dom0, as I understand it, so having F27 blocked on a 'fix' to F26 dom0 seems a bit odd.

Comment 12 Konrad Rzeszutek Wilk 2017-09-05 12:59:16 UTC
Created attachment 1322208 [details]
search -m avc -ts recent" under F26

(In reply to Adam Williamson from comment #11)
> That's, uhh...hmm. A bit of a grey area. The basic point of the criterion
> was to block on domU functionality not dom0, as I understand it, so having
> F27 blocked on a 'fix' to F26 dom0 seems a bit odd.

Hehe. Anyhow just in case that is how you folks want to interpret it that way, I am attaching the output from running "ausearch -m avc -ts recent" under F26 as dom0 (which also has similar SELinux issues, but many more which got fixed in F26 time-frame).

Comment 13 Michael Young 2017-09-05 19:33:10 UTC
On F27 I can get xenconsoled to start on boot in enforcing mode if I do
semanage fcontext -a -t xen_device_t /dev/xen/xenbus
on a previous boot.

If I also set 
allow xenconsoled_t self:capability { sys_resource sys_tty_config };
allow xenconsoled_t self:unix_dgram_socket create;
allow xenconsoled_t var_run_t:sock_file getattr;
allow xenconsoled_t xen_device_t:chr_file map;
in a module I can use xenconsoled to get a console on a xen guest

The relevant entries in the audit.log are

type=AVC msg=audit(1504637347.487:279): avc:  denied  { map } for  pid=857 comm="xenconsoled" path="/dev/xen/gntdev" dev="devtmpfs" ino=11516 scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:object_r:xen_device_t:s0 tclass=chr_file permissive=0
type=AVC msg=audit(1504637347.487:280): avc:  denied  { map } for  pid=857 comm="xenconsoled" path="/dev/xen/privcmd" dev="devtmpfs" ino=16289 scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:object_r:xen_device_t:s0 tclass=chr_file permissive=0
type=AVC msg=audit(1504637758.588:295): avc:  denied  { sys_resource } for  pid=3050 comm="xenconsoled" capability=24  scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:system_r:xenconsoled_t:s0 tclass=capability permissive=0
type=AVC msg=audit(1504637758.588:296): avc:  denied  { create } for  pid=3050 comm="xenconsoled" scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:system_r:xenconsoled_t:s0 tclass=unix_dgram_socket permissive=0
type=AVC msg=audit(1504637758.589:297): avc:  denied  { sys_tty_config } for  pid=3050 comm="xenconsoled" capability=26  scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:system_r:xenconsoled_t:s0 tclass=capability permissive=0
type=AVC msg=audit(1504637758.589:298): avc:  denied  { getattr } for  pid=3050 comm="xenconsoled" path="/run/xenstored/socket" dev="tmpfs" ino=23282 scontext=system_u:system_r:xenconsoled_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=0

Comment 14 Konrad Rzeszutek Wilk 2017-09-18 18:44:36 UTC
Still an issue with Fedora-Server-dvd-x86_64-27-20170912.n.0.iso

Comment 16 Konrad Rzeszutek Wilk 2017-09-29 14:48:25 UTC
Still an issue with Fedora-Server-dvd-x86_64-27_Beta-1.3.iso

Comment 18 Konrad Rzeszutek Wilk 2017-10-09 17:27:52 UTC
And pull request for Fedora's selinux-policy initiated as well:

https://github.com/fedora-selinux/selinux-policy/pull/204


Note You need to log in before you can comment on or make changes to this bug.