Bug 789717 - selinux blocking postrgesql service in rawhide
Summary: selinux blocking postrgesql service in rawhide
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-12 15:18 UTC by Bruno Wolff III
Modified: 2012-02-13 22:34 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-13 22:34:26 UTC
Type: ---


Attachments (Terms of Use)

Description Bruno Wolff III 2012-02-12 15:18:57 UTC
Description of problem:
I noticed that postgresql wasn't starting in rawhide in enforcing mode, but was in permissive mode.
audit2allow showed the following permissions were needed to start it.
#============= postgresql_t ==============
allow postgresql_t tmp_t:file { read unlink open };
allow postgresql_t tmp_t:sock_file unlink;


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

selinux-policy-targeted-3.10.0-86.fc17.noarch
postgresql-server-9.1.2-2.fc17.i686

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Miroslav Grepl 2012-02-13 20:20:57 UTC
Could you attach raw AVC messages?

Comment 2 Bruno Wolff III 2012-02-13 20:29:53 UTC
/var/log/audit/audit.log:type=AVC msg=audit(1329059471.043:263872): avc:  denied  { read } for  pid=7619 comm="postgres" name=".s.PGSQL.5432.lock" dev="dm-0" ino=1704128 scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file
/var/log/audit/audit.log:type=AVC msg=audit(1329059513.193:263875): avc:  denied  { read } for  pid=7859 comm="postgres" name=".s.PGSQL.5432.lock" dev="dm-0" ino=1704128 scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file
/var/log/audit/audit.log:type=AVC msg=audit(1329059513.193:263876): avc:  denied  { open } for  pid=7859 comm="postgres" name=".s.PGSQL.5432.lock" dev="dm-0" ino=1704128 scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file
/var/log/audit/audit.log:type=AVC msg=audit(1329059513.206:263877): avc:  denied  { unlink } for  pid=7859 comm="postgres" name=".s.PGSQL.5432.lock" dev="dm-0" ino=1704128 scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file
/var/log/audit/audit.log:type=AVC msg=audit(1329059513.259:263878): avc:  denied  { unlink } for  pid=7859 comm="postgres" name=".s.PGSQL.5432" dev="dm-0" ino=1715717 scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=sock_file

Comment 3 Daniel Walsh 2012-02-13 22:09:27 UTC
Can you remove the contents of /tmp and try again.  I think this was probably caused by all of the systemd problems we were having and now you have mislabeled sockets in /tmp/

Comment 4 Bruno Wolff III 2012-02-13 22:34:26 UTC
I tried your suggestion (shutting down postgresql, removing stuff in /tmp and my module that allowed the access while waiting for a fix, and then starting postgresql) and it worked. So I am going to close this as not a bug. Thanks for the help.


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