Bug 1648978 - SELinux is preventing plymouthd from 'getattr' accesses on the diretório /sys/firmware/efi/efivars.
Summary: SELinux is preventing plymouthd from 'getattr' accesses on the diretório /sys...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 29
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:bcbdd326b2fbbaa7d37c1200b99...
: 1662191 1662579 1662595 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-12 16:06 UTC by flaviohenriquedesousaribeiro
Modified: 2019-01-21 12:56 UTC (History)
29 users (show)

Fixed In Version: selinux-policy-3.14.2-47.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-21 12:56:38 UTC
Type: ---


Attachments (Terms of Use)

Description flaviohenriquedesousaribeiro 2018-11-12 16:06:15 UTC
Description of problem:
SELinux is preventing plymouthd from 'getattr' accesses on the diretório /sys/firmware/efi/efivars.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/sys/firmware/efi/efivars default label should be sysfs_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /sys/firmware/efi/efivars

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that plymouthd should be allowed getattr access on the efivars directory by default.
Then você deve informar que este é um erro.
Você pode gerar um módulo de política local para permitir este acesso.
Do
allow this access for now by executing:
# ausearch -c 'plymouthd' --raw | audit2allow -M my-plymouthd
# semodule -X 300 -i my-plymouthd.pp

Additional Information:
Source Context                system_u:system_r:plymouthd_t:s0
Target Context                system_u:object_r:efivarfs_t:s0
Target Objects                /sys/firmware/efi/efivars [ dir ]
Source                        plymouthd
Source Path                   plymouthd
Port                          <Desconhecido>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.2-42.fc29.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.18.16-300.fc29.x86_64 #1 SMP Sat
                              Oct 20 23:24:08 UTC 2018 x86_64 x86_64
Alert Count                   1
First Seen                    2018-11-12 09:19:00 -02
Last Seen                     2018-11-12 09:19:00 -02
Local ID                      e4374801-2bc9-4a82-ae96-6cb2ab573dd0

Raw Audit Messages
type=AVC msg=audit(1542021540.430:504): avc:  denied  { getattr } for  pid=18805 comm="plymouthd" path="/sys/firmware/efi/efivars" dev="efivarfs" ino=86 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:efivarfs_t:s0 tclass=dir permissive=0


Hash: plymouthd,plymouthd_t,efivarfs_t,dir,getattr

Version-Release number of selected component:
selinux-policy-3.14.2-42.fc29.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.6
hashmarkername: setroubleshoot
kernel:         4.18.17-300.fc29.x86_64
type:           libreport

Comment 1 xzj8b3 2018-11-22 14:28:01 UTC
Description of problem:
Defauth

Version-Release number of selected component:
selinux-policy-3.14.2-42.fc29.noarch

Additional info:
reporter:       libreport-2.9.6
hashmarkername: setroubleshoot
kernel:         4.19.2-301.fc29.x86_64
type:           libreport

Comment 2 Alon Dotan 2018-11-26 13:12:09 UTC
Description of problem:
I rebooted the system

Version-Release number of selected component:
selinux-policy-3.14.2-42.fc29.noarch

Additional info:
reporter:       libreport-2.9.6
hashmarkername: setroubleshoot
kernel:         4.19.3-300.fc29.x86_64
type:           libreport

Comment 3 Sanjeev 2018-12-05 13:41:54 UTC
Description of problem:
after normal system upgrade

Version-Release number of selected component:
selinux-policy-3.14.2-42.fc29.noarch

Additional info:
reporter:       libreport-2.9.6
hashmarkername: setroubleshoot
kernel:         4.19.5-300.fc29.x86_64
type:           libreport

Comment 4 xzj8b3 2018-12-06 18:21:43 UTC
Description of problem:
Defaulth

Version-Release number of selected component:
selinux-policy-3.14.2-42.fc29.noarch

Additional info:
reporter:       libreport-2.9.6
hashmarkername: setroubleshoot
kernel:         4.19.5-300.fc29.x86_64
type:           libreport

Comment 5 Vladimir Zhelezov 2018-12-10 23:16:28 UTC
Happens to me too on every boot.

The proposed solution, to run restorecon on /sys/firmware/efi/efivars, doesn't have any effect. The type stays unchanged: efivarfs_t. What I did to silence the warning was to build and install a module:

> sudo ausearch -m avc -c plymouthd | audit2allow -M my-plymouthd
> sudo semodule -i my-plymouthd.pp
> cat my-plymouthd.te

module my-plymouthd 1.0;

require {
        type efivarfs_t;
        type plymouthd_t;
        class dir getattr;
}

#============= plymouthd_t ==============
allow plymouthd_t efivarfs_t:dir getattr;

Comment 6 Lukas Vrabec 2018-12-12 12:17:46 UTC
commit 1ee051722534b475f7de087a9df4b95a7097acd6 (HEAD -> rawhide)
Author: Lukas Vrabec <lvrabec@redhat.com>
Date:   Wed Dec 12 13:13:24 2018 +0100

    Add filecontext to /sys/firmware/efi directory efivarfs_t BZ(1648978)

commit f9a2d9e41edb803360694ed505de1fad58cc188c (HEAD -> rawhide)
Author: Lukas Vrabec <lvrabec@redhat.com>
Date:   Wed Dec 12 13:17:29 2018 +0100

    Add efivarfs_t domain to filesystem_type attribute

Comment 7 Richard Shaw 2018-12-15 18:26:05 UTC
Description of problem:
Not sure when it started happening exactly, I don't reboot very often.

Version-Release number of selected component:
selinux-policy-3.14.2-44.fc29.noarch

Additional info:
reporter:       libreport-2.9.7
hashmarkername: setroubleshoot
kernel:         4.19.4-300.fc29.x86_64
type:           libreport

Comment 8 Richard Shaw 2018-12-15 18:28:17 UTC
Is this error benign? It's the only problem I see when I look though my logs after trying to shut down and it stalls and I have to do a hard reset every time.

Comment 9 Artemio 2018-12-26 22:59:01 UTC
*** Bug 1662191 has been marked as a duplicate of this bug. ***

Comment 10 Artemio 2018-12-30 11:56:30 UTC
*** Bug 1662579 has been marked as a duplicate of this bug. ***

Comment 11 Villy Kruse 2018-12-30 14:29:09 UTC
(In reply to Vladimir Zhelezov from comment #5)
> Happens to me too on every boot.
> 
> The proposed solution, to run restorecon on /sys/firmware/efi/efivars,
> doesn't have any effect. The type stays unchanged: efivarfs_t. What I did to
> silence the warning was to build and install a module:
> 

It is a ram-disk file system so no point in fixing the labels.

Comment 12 Mai Ling 2019-01-06 14:47:51 UTC
Description of problem:
appears by itself at logon

Version-Release number of selected component:
selinux-policy-3.14.2-44.fc29.noarch

Additional info:
reporter:       libreport-2.9.7
hashmarkername: setroubleshoot
kernel:         4.20.0-1.fc30.x86_64
type:           libreport

Comment 13 Lukas Vrabec 2019-01-09 10:12:35 UTC
*** Bug 1662595 has been marked as a duplicate of this bug. ***

Comment 14 Fedora Update System 2019-01-13 15:44:35 UTC
selinux-policy-3.14.2-46.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-6a20cfef61

Comment 15 Fedora Update System 2019-01-14 03:02:53 UTC
selinux-policy-3.14.2-46.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-6a20cfef61

Comment 16 Zdenek Pytela 2019-01-15 17:11:41 UTC

*** This bug has been marked as a duplicate of bug 1664143 ***

Comment 17 Fedora Update System 2019-01-17 02:16:20 UTC
selinux-policy-3.14.2-46.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Christian Kujau 2019-01-17 02:38:18 UTC
Description of problem:
Happens during boot. 

Version-Release number of selected component:
selinux-policy-3.14.2-44.fc29.noarch

Additional info:
reporter:       libreport-2.9.7
hashmarkername: setroubleshoot
kernel:         4.19.14-300.fc29.x86_64
type:           libreport

Comment 19 Dominik 'Rathann' Mierzejewski 2019-01-20 22:05:35 UTC
Sorry, but selinux-policy-3.14.2-46.fc29 doesn't fix this bug. I have it installed and I've just encountered this AVC alert:

type=AVC msg=audit(1547557690.092:2152): avc:  denied  { getattr } for  pid=7693 comm="plymouthd" path="/sys/firmware/efi/efivars" dev="efivarfs" ino=13962 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:efivarfs_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1547808645.502:878): avc:  denied  { getattr } for  pid=21774 comm="plymouthd" path="/sys/firmware/efi/efivars" dev="efivarfs" ino=205 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:efivarfs_t:s0 tclass=dir permissive=0

Comment 20 Villy Kruse 2019-01-21 07:06:54 UTC
(In reply to Dominik 'Rathann' Mierzejewski from comment #19)
> Sorry, but selinux-policy-3.14.2-46.fc29 doesn't fix this bug. I have it
> installed and I've just encountered this AVC alert:
> 
> type=AVC msg=audit(1547557690.092:2152): avc:  denied  { getattr } for 
> pid=7693 comm="plymouthd" path="/sys/firmware/efi/efivars" dev="efivarfs"
> ino=13962 scontext=system_u:system_r:plymouthd_t:s0
> tcontext=system_u:object_r:efivarfs_t:s0 tclass=dir permissive=0
> type=AVC msg=audit(1547808645.502:878): avc:  denied  { getattr } for 
> pid=21774 comm="plymouthd" path="/sys/firmware/efi/efivars" dev="efivarfs"
> ino=205 scontext=system_u:system_r:plymouthd_t:s0
> tcontext=system_u:object_r:efivarfs_t:s0 tclass=dir permissive=0

These occurred on Tue Jan 15 14:08:10 2019 and Fri Jan 18 11:50:45 2019.  Was that before or after the upgrade?

date -d @1547557690
Tue 15 Jan 14:08:10 CET 2019

date -d @1547808645
Fri 18 Jan 11:50:45 CET 2019

Comment 21 Dominik 'Rathann' Mierzejewski 2019-01-21 09:01:33 UTC
I updated selinux-policy-3.14.2-46.fc29 (from updates-testing) on 2019-01-14 at 18:50 CET, so both did occur after the upgrade.

$ sudo dnf history list selinux-policy | head -n 3
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
  1627 | --enablerepo=updates-tes | 2019-01-14 18:50 | E, I, U        |   23 E<
$ sudo dnf history info 1627 | grep selinux-policy
    Upgrade  selinux-policy-3.14.2-46.fc29.noarch          @updates-testing
    Upgraded selinux-policy-3.14.2-44.fc29.noarch          @@System
    Upgrade  selinux-policy-targeted-3.14.2-46.fc29.noarch @updates-testing
    Upgraded selinux-policy-targeted-3.14.2-44.fc29.noarch @@System

I'm not sure if running kernel version has anything do with it, but I was running 4.19.13 and .14 at the time:

$ last reboot | head -n 3
reboot   system boot  4.19.15-300.fc29 Fri Jan 18 11:51   still running
reboot   system boot  4.19.14-300.fc29 Tue Jan 15 14:10 - 11:50 (2+21:40)
reboot   system boot  4.19.13-300.fc29 Fri Jan  4 11:34 - 14:09 (11+02:34)

Comment 22 Villy Kruse 2019-01-21 10:51:25 UTC
Meanwhile selinux-policy-3.14.2-47.fc29.noarch is the current version.

Comment 23 Lukas Vrabec 2019-01-21 12:56:38 UTC
Hi, 

I tried this on my system with the latest selinux-policy build: 

# sesearch -A -s plymouthd_t -t efivarfs_t -c dir 
allow plymouthd_t efivarfs_t:dir { getattr open search };

# rpm -q selinux-policy
selinux-policy-3.14.2-47.fc29.noarch

#============= plymouthd_t ==============

#!!!! This avc is allowed in the current policy
allow plymouthd_t efivarfs_t:dir getattr;


So, I'm closing this as current release.


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