Bug 584884

Summary: Device node creation code should use setfscreatecon()
Product: Red Hat Enterprise Linux 5 Reporter: Daniel Walsh <dwalsh>
Component: device-mapperAssignee: Peter Rajnoha <prajnoha>
Status: CLOSED ERRATA QA Contact: Corey Marthaler <cmarthal>
Severity: high Docs Contact:
Priority: low    
Version: 5.5CC: agk, bmarzins, bmr, dwysocha, fnadge, heinzm, jbrassow, jkoten, joe.thornber, junichi.nomura, kueda, lmb, lvm-team, mbroz, msnitzer, prajnoha, prockai, sdsmall
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: device-mapper-1.02.63-2.el5 Doc Type: Bug Fix
Doc Text:
This field is the basis of the errata or release note for this bug. It can also be used for change logs. The Technical Note template, known as CCFR, is as follows: Cause What actions or circumstances cause this bug to present. Consequence What happens when the bug presents. Fix What was done to fix the bug. Result What now happens when the actions or circumstances above occur. Note: this is not the same as the bug doesn’t present anymore.
Story Points: ---
Clone Of: 584381 Environment:
Last Closed: 2011-07-21 06:44:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 584381    
Bug Blocks:    

Comment 1 Daniel Walsh 2010-04-22 16:13:49 UTC
lvm should be useing setfscreatecon before creating the device, rather then changing the device label afterwards.  This opens us to a potential race condition.

Comment 2 Milan Broz 2010-05-18 19:43:00 UTC
I have no idea why the bug is private, but this is the core problem: 

"Looking at the lvm2 source code, it does create the device node and then
relabels it after the fact via lsetfilecon rather than using setfscreatecon()
before calling mknod()."

In rawhide is this code probably obsolete, all nodes and symlinks are created by udev. Ditto for RHEL6. Crypsetup was exception, but it now uses udev too
(I updated it recently with udev code added.)

Anyway I think the upstream should fix even the old path (it is used in RHEL5).

Moving it to RHEL5, because it is main concern there (all fixes are upstream first anyway) and try to do something with that.

Comment 3 Alasdair Kergon 2010-12-06 18:14:08 UTC
So we've another tricky matrix of combinations to work out and support...

Comment 4 Peter Rajnoha 2010-12-13 12:58:59 UTC
Patch for setting the context before the actual node creation is upstream now (device-mapper 1.02.60/lvm2 2.02.79).

Comment 6 Milan Broz 2011-03-04 17:48:31 UTC
Fix in device-mapper-1.02.63-2.el5

Comment 10 Florian Nadge 2011-05-26 15:40:17 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
This field is the basis of the errata or release note for this bug. It can also be used for change logs.

The Technical Note template, known as CCFR, is as follows:

Cause
    What actions or circumstances cause this bug to present.
Consequence
    What happens when the bug presents.
Fix
    What was done to fix the bug.
Result
    What now happens when the actions or circumstances above occur.
    Note: this is not the same as the bug doesn’t present anymore.

Comment 11 errata-xmlrpc 2011-07-21 06:44:36 UTC
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 therefore 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-2011-0981.html