Bug 823728

Summary: selinux block setxattr in CIFS filesystems
Product: Red Hat Enterprise Linux 6 Reporter: Jian Li <jiali>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.4CC: cifs-maint, dwalsh, jlayton, nmurray
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-23 04:15:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jian Li 2012-05-22 02:16:42 UTC
Description of problem:
In CIFS filesystems, when selinux is enforcing, setxattr returns 'permission denied', when selinux is closed, setxattr works well.

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


How reproducible:
Set up samba, and mount from client, create a file, and set xattr on it.
In order to create new file, change shared directory's security attribute:
chcon -t samba_share_t /share/directory

Comment 2 Dan HorĂ¡k 2012-05-22 09:31:20 UTC
sdparm is definitely not the right component, kernel seems more appropriate to me.

Jian Li, please post here the exact commands you run and their outputs, maybe even including lines from /var/log/messages.

Comment 3 Jeff Layton 2012-05-22 10:24:16 UTC
I doubt this is a kernel problem either...probably selinux-policy issue, but it's difficult to know for sure. The description doesn't make it clear whether you're disabling selinux on the client or server here to get it working.

Comment 4 Jian Li 2012-05-23 02:03:31 UTC
sorry, I couldn't manually reproduce it...

I have resubmit a job again, and waiting for result.

beaker job link:  (RHEL6.3-20120509.1)
https://beaker.engineering.redhat.com/jobs/233613

the test(/kernel/filesystems/cifs/xattr) is a standalone test, and setfattr after mounting some local shared directory.

Comment 5 Jian Li 2012-05-23 02:34:14 UTC
fail jobs:

https://beaker.engineering.redhat.com/jobs/236119

checking case, and resubmit job to test with selinux closed.

Comment 6 Jian Li 2012-05-23 04:13:40 UTC
job with selinux closed PASS:
https://beaker.engineering.redhat.com/jobs/236132

Try to manual test and resubmit one on the latest distro.

Comment 7 Jian Li 2012-05-23 04:15:54 UTC
job pass
https://beaker.engineering.redhat.com/jobs/236161

It's case that miss to configure some test file's selinux attribute 'samba_share_t'. 

So it's NOTABUG.