Bug 701587 - selinux prevents nslcd from sys_nice operation
selinux prevents nslcd from sys_nice operation
Product: Fedora
Classification: Fedora
Component: nss-pam-ldapd (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2011-05-03 05:52 EDT by David Spurek
Modified: 2015-02-17 08:44 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-02-17 08:44:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Test (4.62 KB, application/x-bzip)
2011-05-03 05:52 EDT, David Spurek
no flags Details
backtrace (2.04 KB, text/plain)
2011-05-04 15:15 EDT, Nalin Dahyabhai
no flags Details

  None (edit)
Description David Spurek 2011-05-03 05:52:48 EDT
Created attachment 496472 [details]

Description of problem:

Selinux is preventing nslcd from sys_nice operation. Even though this denial
has (probably) not any harmfull effect (i.e. everything works fine), I am quite
sure that the test triggering this AVC does not do anything specific or unsual
and hence there is probably missing rule / transition in the policy.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

1. Configure nss-pam-ldapd to works with openldap over TLS with server certificates,  try getent to user in ldap.
2. Run ausearch -m AVC -ts recent.
Actual results:

type=SYSCALL msg=audit(1304348400.616:89): arch=40000003 syscall=156
success=yes exit=0 a0=aa0 a1=0 a2=bfb2372c a3=b76f3740 items=0
ppid=2719 pid=2720 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0
egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="nslcd"
exe="/usr/sbin/nslcd" subj=system_u:system_r:nslcd_t:s0 key=(null)
type=AVC msg=audit(1304348400.616:89): avc:  denied  { sys_nice } for
pid=2720 comm="nslcd" capability=23
tcontext=system_u:system_r:nslcd_t:s0 tclass=capability

Expected results:


Additional info:

For a detailed reproducer including all necessary configuration, see attached
test, it is written using beakerlib (install beakerlib package). Run it as root
from the test directory by 'bash runtesh.sh'.
Comment 1 Nalin Dahyabhai 2011-05-03 12:42:13 EDT
David, which version of nss-pam-ldapd is this?  I don't see where in the source nslcd is attempting to adjust with its scheduling priority.
Comment 2 David Spurek 2011-05-03 13:08:38 EDT

nslcd.conf is configure with options:
ssl start_tls
tls_reqcert demand

When I run "service nslcd start", the selinux prevents sys_nice operation.

When I run the test added in attachment, selinux is always initiated.
Comment 3 Arthur de Jong 2011-05-04 05:20:02 EDT
No version of nss-pam-ldapd sets the nice level of the daemon. It could be that the crypto library tries to do something funny though.
Comment 4 Nalin Dahyabhai 2011-05-04 15:15:17 EDT
Created attachment 496892 [details]
Comment 5 Nalin Dahyabhai 2011-05-04 17:18:15 EDT
Yes, this appears to be NSS calling sched_setscheduler() when NSPR is initialized, as I also see it when a test program running as nslcd_t calls PR_GetEnv().  That's going to affect a lot of applications.

I don't have a preference between dontaudit or allow in this case, as it doesn't seem to be causing problems, but then the process in question already has the default scheduling set.
Comment 6 Daniel Walsh 2011-05-06 14:31:45 EDT
Is it necessary to call sched_setscheduler within a library?
Comment 7 Nalin Dahyabhai 2011-05-06 17:07:56 EDT
In cases where the current scheduler policy/parameters don't match the desired (documented?) properties for a newly-created thread, I would expect so, but I can't be sure here.  Adding emaldona to the CC list.
Comment 8 Alick Zhao 2012-05-10 09:59:40 EDT
Any new comments on this bug? I met this on CentOS 6 and find the bug report here after google search.
Comment 9 Daniel Walsh 2012-05-10 12:04:16 EDT
This one seems to have dropped through the cracks. Alick are you actually seeing the same AVC?
Comment 10 Fedora End Of Life 2013-04-03 12:27:39 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
Comment 11 Fedora End Of Life 2015-01-09 11:39:16 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

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 19 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 12 Fedora End Of Life 2015-02-17 08:44:16 EST
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 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

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.