Bug 1410229 - SELinux is preventing (xinit) from setattr access on the chr_file tty1.
Summary: SELinux is preventing (xinit) from setattr access on the chr_file tty1.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 25
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-04 20:18 UTC by Charles-Henri d'Adhémar
Modified: 2017-12-12 10:15 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 10:15:16 UTC
Type: Bug


Attachments (Terms of Use)
kodi systemd service using xinit (443 bytes, text/plain)
2017-01-04 20:18 UTC, Charles-Henri d'Adhémar
no flags Details

Description Charles-Henri d'Adhémar 2017-01-04 20:18:28 UTC
Created attachment 1237314 [details]
kodi systemd service using xinit

Hello,

I want to execute Kodi as a systemd service using xinit.
See attached systemd service.

SELinux is preventing xinit to modify the related tty device.

I spent many days at trying to get into SELinux, playing with labels (trying to give xinit the xdm_exec_t), trying to build a custom module (getting constraints violation I do not understand or know how to fix them), trying to build a custom domain with permissive mode, and finally I gave up putting the whole SELinux into permissive until this issue is fixed.

Please see below the SELinux AVC.

Any help to either  relabel xinit, build a custom module as a workaround until this issue is fixed so that I can put SELinux back into enforcing would be appreciated, please.

Thank you very much.

SELinux is preventing (xinit) from setattr access on the chr_file tty1.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that (xinit) should be allowed setattr access on the tty1 chr_file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c '(xinit)' --raw | audit2allow -M my-xinit
# semodule -X 300 -i my-xinit.pp


Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                unconfined_u:object_r:user_tty_device_t:s0
Target Objects                tty1 [ chr_file ]
Source                        (xinit)
Source Path                   (xinit)
Port                          <Unknown>
Host                          horous
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.3.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     horous
Platform                      Linux horous 4.8.15-300.fc25.x86_64 #1 SMP Thu Dec
                              15 23:10:23 UTC 2016 x86_64 x86_64
Alert Count                   2
First Seen                    2017-01-03 22:15:21 CET
Last Seen                     2017-01-04 20:38:03 CET
Local ID                      0f76859d-a576-4d6b-813d-0c7ec718ddbd

Raw Audit Messages
type=AVC msg=audit(1483558683.152:356): avc:  denied  { setattr } for  pid=2857 comm="(xinit)" name="tty1" dev="devtmpfs" ino=1042 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_u:object_r:user_tty_device_t:s0 tclass=chr_file permissive=1


Hash: (xinit),init_t,user_tty_device_t,chr_file,setattr

Comment 1 Fedora End Of Life 2017-11-16 18:43:35 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. 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 '25'.

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 25 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 2 Fedora End Of Life 2017-12-12 10:15:16 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 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.


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