Bug 811656 - setsebool -P is terribly slow
setsebool -P is terribly slow
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: policycoreutils (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-11 11:59 EDT by Bill Nottingham
Modified: 2014-03-16 23:30 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-16 13:53:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bill Nottingham 2012-04-11 11:59:36 EDT
Description of problem:

# time setsebool -P  deny_ptrace=false

real	1m27.838s
user	1m24.839s
sys	0m0.700s

I realize that opening this box might open an entire pandora's box of problems with how policy is assembled and built, but... 90 seconds to flip one boolean is awful.

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

policycoreutils-2.1.10-29.fc17.x86_64
selinux-policy-3.10.0-110.fc17.noarch

How reproducible:

100%

Steps to Reproduce:
1. set a boolean
2. wait for it
3. wait for it
  
Actual results:

Slooooooooow

Expected results:

Fast. Ideally not much, if any, slower than setting a non-persistent boolean.

Additional info:
Comment 1 Miroslav Grepl 2012-04-12 03:30:21 EDT
Is this on a virtual machine?

I see

# time setsebool -P  deny_ptrace=false

real	0m13.920s
user	0m12.718s
sys	0m1.004s
Comment 2 Bill Nottingham 2012-04-12 11:03:39 EDT
No, bare hardware, Core i7. If there is something I can do to get a better profile of what it's doing (either a trace mode, or oprofile, or whatever), just ask.
Comment 3 Daniel Walsh 2012-04-12 17:06:05 EDT
It is doing a full compile of the policy.

 time setsebool -P deny_ptrace=true

real	0m9.660s
user	0m9.295s
sys	0m0.251s

ThinkPad X220 on SSD

grep expand-check /etc/selinux/semanage.conf 
# expand-check check neverallow rules when executing all semanage commands.
expand-check=0
Comment 4 Bill Nottingham 2012-04-12 17:08:08 EDT
Why is the compile so long on my box? (x201s, also ssd).

expand-check is also 0 for me.
Comment 5 Daniel Walsh 2012-04-13 12:13:30 EDT
No clue.

Is it repeatable?
Comment 6 Bill Nottingham 2012-04-13 12:22:04 EDT
Yes, happens every time.
Comment 7 Daniel Walsh 2012-04-13 15:40:16 EDT
Eric have any ideas?
Comment 8 Adhidarma Hadiwinoto 2012-06-19 12:19:40 EDT
Confirmed problem. Slow on my laptop too.
Comment 9 Daniel Walsh 2012-06-19 14:43:03 EDT
I believe we have a fix.  But if you want it faster, and your system to be a little more secure.

semodule -d unconfined

Which will disable most of the unconfined domains on your system.  unconfined_t will still work.
Comment 10 Daniel Walsh 2012-10-16 13:53:43 EDT
This is fixed in Fedora 18.

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