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)
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2 (Show other bugs)
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Milan Broz
Brian Brock
Depends On:
  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:
Last Closed: 2008-05-21 11:39:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 
restorecon -v .cache
which failed with the message:
lstat(.cache) failed: No such file or directory

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

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 

Steps to Reproduce:
1. pvcreate /dev/mapper/<devicename>
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

Upstream has fixed this problem by moving the cache file to a subdirectory
Fedora 7 8 and beyond.
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
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
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.


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