Bug 811656 - setsebool -P is terribly slow
Summary: setsebool -P is terribly slow
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: policycoreutils
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-11 15:59 UTC by Bill Nottingham
Modified: 2014-03-17 03:30 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-16 17:53:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Bill Nottingham 2012-04-11 15:59:36 UTC
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 07:30:21 UTC
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 15:03:39 UTC
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 21:06:05 UTC
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 21:08:08 UTC
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 16:13:30 UTC
No clue.

Is it repeatable?

Comment 6 Bill Nottingham 2012-04-13 16:22:04 UTC
Yes, happens every time.

Comment 7 Daniel Walsh 2012-04-13 19:40:16 UTC
Eric have any ideas?

Comment 8 Adhidarma Hadiwinoto 2012-06-19 16:19:40 UTC
Confirmed problem. Slow on my laptop too.

Comment 9 Daniel Walsh 2012-06-19 18:43:03 UTC
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 17:53:43 UTC
This is fixed in Fedora 18.


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