Bug 436640

Summary: security_context_to_sid fails for tmpfs
Product: Red Hat Enterprise Linux 5 Reporter: Rik van Riel <riel>
Component: kernelAssignee: Red Hat Kernel Manager <kernel-mgr>
Status: CLOSED NOTABUG QA Contact: Martin Jenner <mjenner>
Severity: low Docs Contact:
Priority: low    
Version: 5.1CC: eparis
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-08 23:18:22 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:

Description Rik van Riel 2008-03-08 19:03:16 UTC
Description of problem:

In /etc/fstab:

tmpfs                   /var/spool/exim/input   tmpfs  
uid=exim,gid=exim,context=system_u:object_r:var_spool_t,size=20M,mode=0750 0 0
tmpfs                   /var/spool/spamikaze    tmpfs  
uid=exim,gid=exim,context=system_u:object_r:var_spool_t,size=20M,mode=0750 0 0

Trying to mount these filesystems fails with:

# mount /var/spool/spamikaze/
SELinux: security_context_to_sid(system_u:object_r:var_spool_t) failed for (dev
tmpfs, type tmpfs) errno=-22

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

2.6.18-53.1.6.el5xen

Expected results:

The security context is valid, since other directories are labeled that way.  I
have no idea why security_context_to_sid would fail for an already known context.

It would be nice if the tmpfs mount worked...

Comment 1 Rik van Riel 2008-03-08 23:18:22 UTC
Never mind - the security context now needs an :s0 appended for this to work.