Bug 1045773 - incorrect selinux label on /run/pkcsslotd.socket
Summary: incorrect selinux label on /run/pkcsslotd.socket
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: 2013-12-21 22:23 UTC by Michael S.
Modified: 2014-01-06 22:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-06 22:00:40 UTC
Type: Bug


Attachments (Terms of Use)

Description Michael S. 2013-12-21 22:23:02 UTC
When starting pkcsslotd ( in opencryptoki-3.0-6.fc20.x86_64 ), it create a socket in /run :

$ ls -lZ /run/pkcsslotd.socket            
srwxrwx---. root pkcs11 system_u:object_r:pkcsslotd_var_run_t:s0 /run/pkcsslotd.socket

However, when running restorecon :
$ sudo restorecon -Rv /run/pkcsslotd.*    
/sbin/restorecon reset /run/pkcsslotd.socket context system_u:object_r:pkcsslotd_var_run_t:s0->system_u:object_r:var_run_t:s0

$ ls -lZ /run/pkcsslotd.socket        
srwxrwx---. root pkcs11 system_u:object_r:var_run_t:s0   /run/pkcsslotd.socket

I think it shouldn't be reset like this, as someone trying to fix some problem would just create more issues.

Comment 1 Daniel Walsh 2014-01-02 23:12:14 UTC
grep /run/pkcsslotd /etc/selinux/targeted/contexts/files/file_contexts
/var/run/pkcsslotd.*	system_u:object_r:pkcs_slotd_var_run_t:s0

Comment 2 Michael S. 2014-01-03 11:01:38 UTC
Would the file context also match if the file is /run rather than /var/run, ( I mean, at creation time ) ?

as I do have the same result than you, but I can still reproduce the problem of having the socket wrongly labelled when pkcsslotd is started.

Comment 3 Daniel Walsh 2014-01-03 17:49:20 UTC
Yes /run == /var/run, there is a file equivalence.

matchpathcon /run/pkcsslotd.socket

Comment 4 Michael S. 2014-01-03 21:17:43 UTC
$ matchpathcon /run/pkcsslotd.socket    
/run/pkcsslotd.socket	system_u:object_r:var_run_t:s0

Comment 5 Miroslav Grepl 2014-01-06 11:01:00 UTC
If you execute

# yum reinstall selinux-policy-targeted

does it  blow up?

Comment 6 Michael S. 2014-01-06 20:47:17 UTC
That indeed fix the issue so I guess I can close it ?


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