Bug 1385408

Summary: maintenance mode in Fedora 24 comes with AVC denials, things that should work don't work
Product: [Fedora] Fedora Reporter: Rudd-O DragonFear <rudd-o>
Component: systemdAssignee: systemd-maint
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: bloch, johannbg, lnykryn, msekleta, muadda, ssahani, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-08 19:27:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Rudd-O DragonFear 2016-10-16 22:24:01 UTC
Description of problem:

Entering emergency.target on boot shows this:

[  OK  ] Started Cleanup udevd DB.
[  OK  ] Reached target Switch Root.
         Starting Switch Root...
Switching root.
[  152.754922] SELinux:  Permission validate_trans in class security not defined in policy.
[  152.755807] SELinux:  Permission module_load in class system not defined in policy.
[  152.757424] SELinux: the above unknown classes and permissions will be allowed
[  152.874389] audit_printk_skb: 75 callbacks suppressed
[  152.874975] audit: type=1403 audit(1476656342.057:49): policy loaded auid=4294967295 ses=4294967295
[  152.941857] systemd[1]: Successfully loaded SELinux policy in 1.507188s.
[  153.402845] systemd[1]: Relabelled /dev and /run in 217.881ms.
systemd 229 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Detected virtualization bochs.
Detected architecture x86-64.

Welcome to Fedora 24 (Twenty Four)!

Set hostname to <seed.dragonfear>.
[  OK  ] Stopped Journal Service.
[  154.968944] audit: type=1130 audit(1476656344.151:50): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-journald comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  154.970553] audit: type=1131 audit(1476656344.153:51): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-journald comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  OK  ] Stopped Switch Root.
[  154.987018] audit: type=1130 audit(1476656344.169:52): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=initrd-switch-root comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  154.991472] audit: type=1131 audit(1476656344.174:53): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=initrd-switch-root comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
systemd-journald.service: Service has no hold-off time, scheduling restart.
[  155.034271] audit: type=1400 audit(1476656344.216:54): avc:  denied  { create } for  pid=1 comm="systemd" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:syslogd_t:s0 tclass=netlink_audit_socket permissive=0
systemd-journald-audit.socket: Failed to listen on sockets: Permission denied
[  OK  ] Closed Journal Audit Socket.
systemd-journald-audit.socket: Unit entered failed state.
[  OK  ] Stopped Journal Service.
[  155.104516] audit: type=1130 audit(1476656344.287:55): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-journald comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  155.105510] audit: type=1131 audit(1476656344.288:56): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-journald comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
         Starting Journal Service...
[  OK  ] Stopped target Switch Root.
[  OK  ] Started Emergency Shell.
[  155.169613] audit: type=1130 audit(1476656344.352:57): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=emergency comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  OK  ] Stopped target Initrd File Systems.
[  OK  ] Stopped target Initrd Root File System.
[  OK  ] Reached target Emergency Mode.
[  OK  ] Started Journal Service.
Startup finished in 3.433s (kernel) + 2min 27.918s (initrd) + 4.490s (userspace) = 2min 35.842s.
[  155.848758] audit: type=1130 audit(1476656345.031:58): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-journald comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
emergency.service: Failed at step EXEC spawning /bin/plymouth: No such file or directory
Welcome to emergency mode! After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or ^D to
try again to boot into default mode.
Give root password for maintenance
(or press Control-D to continue): 


systemctl --failed shows this:

[root@seed ~]# systemctl --failed
  UNIT                         LOAD   ACTIVE SUB    DESCRIPTION
● systemd-journald-audit.socket loaded failed failed Journal Audit Socket

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

systemctl status systemd-journald-audit.socket shows this:


[root@seed ~]# systemctl status systemd-journald-audit.socket
● systemd-journald-audit.socket - Journal Audit Socket
   Loaded: loaded (/usr/lib/systemd/system/systemd-journald-audit.socket; static
   Active: failed (Result: resources) since Sun 2016-10-16 22:19:04 UTC; 3min 51
     Docs: man:systemd-journald.service(8)
           man:journald.conf(5)
   Listen: audit 1 (Netlink)

Warning: Journal has been rotated since unit was started. Log output is incomple


From the units I tested (poweroff, reboot, emergency) if ANY unit that is not multi-user.target is requested upon boot, then SELinux AVC denials basically sabotage the boot.

Comment 1 Rudd-O DragonFear 2016-10-16 22:25:10 UTC
Poweroff after emergency also appears hosed:

-------------------------------

[root@seed ~]# poweroff
[  OK  ] Stopped target Emergency Mode.
         Stopping Cryptography Setup for luk...c-c05a-489e-aafb-3e59e6e8fcad...
         Unmounting Configuration File System...
         Stopping Emergency Shell...
[  OK  ] Stopped Emergency Shell.
[  470.084918] audit: type=1131 audit(1476656659.266:59): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=emergency comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  OK  ] Unmounted Configuration File System.
[*     ] A stop job is running for Cryptogra...afb-3e59e6e8fcad (5s / no limit)[  475.495611] systemd-cryptsetup[1391]: Failed to deactivate: Device or resource busy
systemd-cryptsetup@luks\x2d89ae5edc\x2dc05a\x2d489e\x2daafb\x2d3e59e6e8fcad.service: Control process exited, code=exited status=1
[  OK  ] Stopped Cryptography Setup for luks...edc-c05a-489e-aafb-3e59e6e8fcad.
systemd-cryptsetup@luks\x2d89ae5edc\x2dc05a\x2d489e\x2daafb\x2d3e59e6e8fcad.service: Unit entered failed state.
[  475.629709] audit: type=1130 audit(1476656664.812:60): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-cryptsetup@luks\x2d89ae5edc\x2dc05a\x2d489e\x2daafb\x2d3e59e6e8fcad comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
systemd-cryptsetup@luks\x2d89ae5edc\x2dc05a\x2d489e\x2daafb\x2d3e59e6e8fcad.service: Failed with result 'exit-code'.
[  OK  ] Reached target Unmount All Filesystems.
[  OK  ] Removed slice system-systemd\x2dcryptsetup.slice.
[  OK  ] Reached target Shutdown.
Shutting down.
Sending SIGTERM to remaining processes...
Sending SIGKILL to remaining processes...
Unmounting file systems.
Remounting '/' read-only with options 'seclabel,xattr,noacl'.
Remounting '/' read-only with options 'seclabel,xattr,noacl'.
All filesystems unmounted.
Deactivating swaps.
All swaps deactivated.
Detaching loop devices.
All loop devices detached.
Detaching DM devices.
Detaching DM 253:0.
[  476.581494] dev_remove: 15 callbacks suppressed
Could not detach DM /dev/dm-0: Device or resource busy
Not all DM devices detached, 1 left.
Cannot finalize remaining DM devices, continuing.
Failed to finalize  DM devices, ignoring
Powering off.
[  476.782455] sd 0:0:1:0: [sda] Synchronizing SCSI cache
[  476.783856] sd 0:0:1:0: [sda] Stopping disk
[  476.786738] ACPI: Preparing to enter system sleep state S5
[  476.789795] reboot: Power down

Comment 2 Rudd-O DragonFear 2016-10-16 22:27:23 UTC
(By "hosed" I mean the Dracut cleanup / shutdown stage never executes, even though it should, as I have confirmed there are shutdown scripts which must run.)

Comment 3 Fedora End Of Life 2017-07-25 23:30:30 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2017-08-08 19:27:18 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.