Red Hat Bugzilla – Bug 584884
Device node creation code should use setfscreatecon()
Last modified: 2011-07-21 02:44:36 EDT
lvm should be useing setfscreatecon before creating the device, rather then changing the device label afterwards. This opens us to a potential race condition.
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.
So we've another tricky matrix of combinations to work out and support...
Patch for setting the context before the actual node creation is upstream now (device-mapper 1.02.60/lvm2 2.02.79).
Fix in device-mapper-1.02.63-2.el5
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.
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:
What actions or circumstances cause this bug to present.
What happens when the bug presents.
What was done to fix the bug.
What now happens when the actions or circumstances above occur.
Note: this is not the same as the bug doesn’t present anymore.
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.