Bug 1406520
| Summary: | calling libselinux python restorecon fails on /var/lib/nfs/rpc_pipefs | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Brent Baude <bbaude> | ||||||
| Component: | libselinux | Assignee: | Petr Lautrbach <plautrba> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Milos Malik <mmalik> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | high | ||||||||
| Version: | 7.3 | CC: | dwalsh, jguthrie, jlebon, jmelvin, lars, lvrabec, mgrepl, mmalik, plautrba, scollier, ssekidde | ||||||
| Target Milestone: | rc | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | libselinux-2.5-7.el7 | Doc Type: | If docs needed, set a value | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | |||||||||
| : | 1411700 (view as bug list) | Environment: | |||||||
| Last Closed: | 2017-08-01 17:43:16 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
Brent Baude
2016-12-20 19:09:59 UTC
Created attachment 1234028 [details]
cloud-init log
This is blocking enablement of RHEL Atomic on Azure which is why I jacked up the priority. Just to elaborate, it seems like the issue is that /var/lib/nfs/rpc_pipefs is explicitly undefined: # semanage fcontext -l | grep rpc_pipefs /var/lib/nfs/rpc_pipefs(/.*)? all files <<None>> which is probably why the matchpathcon() fails. The rpc_pipefs mount itself is indeed properly labeled as per the refpolicy. Maybe selinux.restorecon() should have a skip_undefined optional bool? To compare the CLI equivalent does not error out on this and instead just prints a warning message. I tested the suggestion by Dan Walsh at https://github.com/fedora-selinux/selinux/pull/35 and it worked perfectly for my use. Let's monitor the upstream response and then patch the RH package as soon as possible. Petr can we get this backported to RHEL7? old version ======== # rpm -qa libselinux\* libselinux-2.5-6.el7.x86_64 libselinux-utils-2.5-6.el7.x86_64 libselinux-python-2.5-6.el7.x86_64 # matchpathcon /run/*.pid /run/auditd.pid system_u:object_r:auditd_var_run_t:s0 /run/crond.pid system_u:object_r:crond_var_run_t:s0 /run/dhclient-eth0.pid system_u:object_r:dhcpc_var_run_t:s0 /run/gssproxy.pid system_u:object_r:gssproxy_var_run_t:s0 /run/lvmetad.pid <<none>> /run/rhnsd.pid system_u:object_r:rhnsd_var_run_t:s0 /run/rpc.statd.pid system_u:object_r:rpcd_var_run_t:s0 /run/sm-notify.pid system_u:object_r:rpcd_var_run_t:s0 /run/sshd.pid system_u:object_r:sshd_var_run_t:s0 /run/syslogd.pid system_u:object_r:syslogd_var_run_t:s0 # python Python 2.7.5 (default, Aug 2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import selinux >>> selinux.restorecon('/run/lvmetad.pid') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.7/site-packages/selinux/__init__.py", line 85, in restorecon status, context = matchpathcon(path, mode) OSError: [Errno 2] No such file or directory >>> new version ======== # rpm -qa libselinux\* libselinux-2.5-7.el7.x86_64 libselinux-utils-2.5-7.el7.x86_64 libselinux-python-2.5-7.el7.x86_64 # matchpathcon /run/*.pid /run/auditd.pid system_u:object_r:auditd_var_run_t:s0 /run/crond.pid system_u:object_r:crond_var_run_t:s0 /run/dhclient-eth0.pid system_u:object_r:dhcpc_var_run_t:s0 /run/gssproxy.pid system_u:object_r:gssproxy_var_run_t:s0 /run/lvmetad.pid <<none>> /run/rhnsd.pid system_u:object_r:rhnsd_var_run_t:s0 /run/rpc.statd.pid system_u:object_r:rpcd_var_run_t:s0 /run/sm-notify.pid system_u:object_r:rpcd_var_run_t:s0 /run/sshd.pid system_u:object_r:sshd_var_run_t:s0 /run/syslogd.pid system_u:object_r:syslogd_var_run_t:s0 [0 root@qeos-100 ~]# python Python 2.7.5 (default, Aug 2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import selinux >>> selinux.restorecon('/run/lvmetad.pid') >>> The fix is OK. Of course, it works well with /var/lib/nfs/rpc_pipefs. Brent do we need this prior to 7.4? In comment 6, Milos says he will do a zstream which will help with testing. Other that, we dont need earlier (like RHEL6) *** Bug 1396293 has been marked as a duplicate of this bug. *** *** Bug 1396293 has been marked as a duplicate of this bug. *** (In reply to Brent Baude from comment #14) > In comment 6, Milos says he will do a zstream which will help with testing. > Other that, we dont need earlier (like RHEL6) Actually, I am seeing the symptoms of bug 1396293 in CentOS 6.8: # python Python 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import selinux >>> selinux.restorecon('/var/lib/nfs/rpc_pipefs') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.6/site-packages/selinux/__init__.py", line 80, in restorecon status, context = matchpathcon(path, mode) OSError: [Errno 2] No such file or directory I'm aware that since this comes from CentOS, it doesn't necessarily affect RHEL, but I thought I would mention it since there probably are chef users affected by bug 1396293 under RHEL 6.8. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:1853 |