Bug 1196815

Summary: SELinux is preventing telinit from using the 'sys_resource' capabilities.
Product: [Fedora] Fedora Reporter: austinenglish
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 21CC: alexvillacislasso, antonio.montagnani, aselene, aurisc4, berend.de.schouwer, billcrawford1970, bugzilla_acct_1959, bugzilla, bztdlinux, chmelarz, cyrusyzgtt, daniel-fedoauth, dominick.grift, doug.huffman1, dwalsh, eblake, edosurina, esteban.xandri, extras-qa, hafflys, hancockrwd, hark110, henryju, hk.stefansson, hopparz, hx, igeorgex, jamescape777, jeharris, jlbouras, jlmagee, johannbg, jskarvad, jsynacek, kparal, kvolny, lnykryn, loganjerry, long, lsm5, lvrabec, macattack278, marwalk, matt, maxim.galamay, mgrepl, milan.kerslager, mjs, msekleta, patrys, pavel.srb, plautrba, projects.rg, rob+redhat, rocketraman, rz, sghosh, snowwolf007cn, s, systemd-maint, teccie, teupoui, vpavlin, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:cdc2682adf9b9727142d459fe535d8d7dcd2db63c49d69beec36f233a262b811
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1184712 Environment:
Last Closed: 2015-02-27 11:15:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description austinenglish 2015-02-26 19:44:21 UTC
Similar to bug 1184712, but in telinit.SELinux is preventing telinit from using the sys_resource capability.

*****  Plugin sys_resource (91.4 confidence) suggests   **********************

If you do not want processes to require capabilities to use up all the system resources on your system;
Then you need to diagnose why your system is running out of system resources and fix the problem.  

According to /usr/include/linux/capability.h, sys_resource is required to:

/* Override resource limits. Set resource limits. */
/* Override quota limits. */
/* Override reserved space on ext2 filesystem */
/* Modify data journaling mode on ext3 filesystem (uses journaling
   resources) */
/* NOTE: ext2 honors fsuid when checking for resource overrides, so
   you can override using fsuid too */
/* Override size restrictions on IPC message queues */
/* Allow more than 64hz interrupts from the real-time clock */
/* Override max number of consoles on console allocation */
/* Override max number of keymaps */
/* Override resource limits. Set resource limits. */
/* Override quota limits. */
/* Override reserved space on ext2 filesystem */
/* Modify data journaling mode on ext3 filesystem (uses journaling
   resources) */
/* NOTE: ext2 honors fsuid when checking for resource overrides, so
   you can override using fsuid too */
/* Override size restrictions on IPC message queues */
/* Allow more than 64hz interrupts from the real-time clock */
/* Override max number of consoles on console allocation */
/* Override max number of keymaps */
/* Override resource limits. Set resource limits. */
/* Override quota limits. */
/* Override reserved space on ext2 filesystem */
/* Modify data journaling mode on ext3 filesystem (uses journaling
   resources) */
/* NOTE: ext2 honors fsuid when checking for resource overrides, so
   you can override using fsuid too */
/* Override size restrictions on IPC message queues */
/* Allow more than 64hz interrupts from the real-time clock */
/* Override max number of consoles on console allocation */
/* Override max number of keymaps */

Do
fix the cause of the SYS_RESOURCE on your system.

*****  Plugin catchall (9.59 confidence) suggests   **************************

If you believe that telinit should have the sys_resource capability 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:
# grep telinit /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:prelink_cron_system_t:s0-s0:c0.c
                              1023
Target Context                system_u:system_r:prelink_cron_system_t:s0-s0:c0.c
                              1023
Target Objects                Unknown [ capability ]
Source                        telinit
Source Path                   telinit
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-105.3.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 3.17.8-300.fc21.x86_64
                              #1 SMP Thu Jan 8 23:32:49 UTC 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2015-02-26 03:16:48 CST
Last Seen                     2015-02-26 03:16:48 CST
Local ID                      -removed-

Raw Audit Messages
type=AVC msg=audit(1424942208.513:1799): avc:  denied  { sys_resource } for  pid=30345 comm="telinit" capability=24  scontext=system_u:system_r:prelink_cron_system_t:s0-s0:c0.c1023 tcontext=system_u:system_r:prelink_cron_system_t:s0-s0:c0.c1023 tclass=capability permissive=0


Hash: telinit,prelink_cron_system_t,prelink_cron_system_t,capability,sys_resource

Comment 1 Lukas Vrabec 2015-02-27 11:15:33 UTC

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