Bug 291411 - SELinux is preventing /usr/sbin/lvm (lvm_t) "write" to .cache (lvm_etc_t)
SELinux is preventing /usr/sbin/lvm (lvm_t) "write" to .cache (lvm_etc_t)
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2 (Show other bugs)
5.0
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Milan Broz
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-14 14:21 EDT by Andy Loftus
Modified: 2013-02-28 23:05 EST (History)
7 users (show)

See Also:
Fixed In Version: RHBA-2008-0378
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 11:39:35 EDT
Type: ---
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 Andy Loftus 2007-09-14 14:21:04 EDT
Description of problem:
When I run 'pvcreate /dev/mapper/sdd7_[01]' (which are multipath aliases for /
dev/mapper/dm-[34], respectively), I see this in /var/log/messages:

Sep 14 12:58:32 venom setroubleshoot:      SELinux is preventing /usr/sbin/lvm 
(lvm_t) "write" to .cache (lvm_etc_t).      For complete SELinux messages. run 
sealert -l a4364cd2-25ef-4851-9e81-8760a8e3d9a4

I ran the sealert command specified above and it told me to try running this 
command:
restorecon -v .cache
which failed with the message:
lstat(.cache) failed: No such file or directory




Version-Release number of selected component (if applicable):
lvm2-2.02.16-3.el5
device-mapper-1.02.13-1.el5
device-mapper-multipath-0.4.7-8.el5


How reproducible: Consistent.  I did 'dd if=/dev/zero of=/dev/mapper/<device> 
bs=1024 count=1' to each device, then re-run pvcreate and I get the same 
message.


Steps to Reproduce:
1. pvcreate /dev/mapper/<devicename>
2. 
3. 
  
Actual results: 


Expected results: no SElinux errors


Additional info:  also happens with vgcreate, vgchange, vgdislpay.  Assume it 
will happen with all the LVM cmds.
Comment 1 Daniel Walsh 2007-09-14 17:01:32 EDT
restorecon -R -v /etc/lvm

Should fix the context, but some app is causing it to be written with the wrong
context.

Upstream has fixed this problem by moving the cache file to a subdirectory
Fedora 7 8 and beyond.
/etc/lvm/cache/
Comment 2 Daniel Walsh 2007-10-09 09:58:02 EDT
There is one of two solutions to this problem.  Backport the change from Rawhide
that moves /etc/lvm/.cache to /etc/lvm/cache/.cache or just allow lvm to write
to any of its config files.

Comment 3 Alasdair Kergon 2007-11-01 22:39:33 EDT
Backport.
Comment 4 RHEL Product and Program Management 2007-11-01 22:44:31 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 5 Milan Broz 2008-01-17 19:23:34 EST
In lvm2-2.02.30-1.el5.
Comment 8 errata-xmlrpc 2008-05-21 11:39:35 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0378.html

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