-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
samba: Make adjustments to vfs_acl_xattr configuration #109
Conversation
9beb728
to
0693121
Compare
Make sure that the Samba's mapping to POSIX ACLs is present on the backend file system so that high level access control entries(if not fine grained or rich as in NT ACLs) are visible to other protocol clients as a reference. Signed-off-by: Anoop C S <[email protected]>
security namespace when used for storing NTACLs with acl_xattr VFS module requires CAP_SYS_ADMIN capability to successfully modify xattrs. vfs_acl_xattr is capable enough to configure the xattr namespace(and literally the whole name) using module options in smb.conf. In certain deployment situations where services are run within containers we lack CAP_SYS_ADMIN which then calls for a more flexible xattr name/namespace. Signed-off-by: Anoop C S <[email protected]>
0693121
to
37750e2
Compare
With the changes from this PR we have the following failures: XFS and CephFS kclient
Earlier with On the other side when Even with customized local SELinux policy smb2.session.reauth4(but not others) still remained unsuccessful with the error changed to
But this time it failed to set POSIX ACL(system.posix_acl_access) because the attempt(from smbd) was made as Anonymous user(nobody) even though we operate using a valid open file handle from the owner. That's one of the places where Samba slightly bend POSIX ACL behaviour in the direction of Windows. CephFS vfs |
For the time being, until the official fix[1] is available with standard selinux-policy packages, compile and insert a local SELinux policy to allow smbd to use cap_dac_override in certain situations to cope with limitations of lossy mapping to POSIX ACLs. Refer comments from [2] for more details. [1] fedora-selinux/selinux-policy#1990 [2] samba-in-kubernetes#109 Signed-off-by: Anoop C S <[email protected]>
I've added an extra commit to temporarily get around the SELinux problems until fixes come in via official packages. So we are left with only the failure from smb2.session.reauth4.
Since we do not have variant specific flapping list for each backend I'm not sure whether to add smb2.session.reauth4 blindly to flapping.cephfs as it will affect both CephFS(kclient) and CephFS(vfs). @spuiuk any thoughts? |
With recent changes to smb.conf[1] smb2.session.reauth4 is expected to fail on XFS. Refer [1] for more deails. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With recent changes to smb.conf[1], smb2.session.reauth4 is expected to fail on CephFS kclient method. Refer [1] for more details. Also remember that this is not a problem with CephFS vfs approach but our clone of selftest mechanism currently lacks the ability to consider flapping lists based on variants for a particular backend. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
Adding @synarete to this conversation since he seems to be hitting this problem on vfs_ceph_new and didn't have "ignore system acls" set to true in his test setup. |
Let's cover the flapping list issue in the corresponding PR for sit-test-cases |
For the time being, until the official fix[1] is available with standard selinux-policy packages, compile and insert a local SELinux policy to allow smbd to use cap_dac_override in certain situations to cope with limitations of lossy mapping to POSIX ACLs. Refer comments from [2] for more details. [1] fedora-selinux/selinux-policy#1990 [2] samba-in-kubernetes#109 Signed-off-by: Anoop C S <[email protected]>
I gave it a try with the following share configuration..
..and it turned out to be successful here. |
With certain samba configurations we might require a separate flapping list for variants of a backend. One such situation is detailed in [1] where specific test run results differ among backend variants. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With certain samba configurations we might require a separate flapping list for variants of a backend. One such situation is detailed in [1] where specific test run results differ among variants of a particular backend. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With recent changes to smb.conf[1] smb2.session.reauth4 is expected to fail on XFS. Refer [1] for more deails. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With recent changes to smb.conf[1], smb2.session.reauth4 is expected to fail on CephFS kclient method. Refer [1] for more details. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
I am curious about why it fails with ceph kernel mount. The uid/gid at the time of the operation would be set to nobody/nobody but the open fd would have been opened as the user and the effective uid of the process is set to 0. That should have worked in my opinion. |
As I explained above #109 (comment) the failure happens when we try to set POSIX ACL(system.posix_acl_access) as Anonymous user(not as root). In effect smbd performs the operation as nobody and the file system lacks write permission for anyone but owner. Thus we face |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had a call with Anoop where he described the problem in more detail. Makes sense now.
ACK
With certain samba configurations we might require a separate flapping list for variants of a backend. One such situation is detailed in [1] where specific test run results differ among variants of a particular backend. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With recent changes to smb.conf[1] smb2.session.reauth4 is expected to fail on XFS. Refer [1] for more deails. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With recent changes to smb.conf[1], smb2.session.reauth4 is expected to fail on CephFS kclient method. Refer [1] for more details. Also remember that this is not a problem with CephFS vfs approach but our clone of selftest mechanism currently lacks the ability to consider flapping lists based on variants for a particular backend. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With recent changes to smb.conf[1] smb2.session.reauth4 is expected to fail on XFS. Refer [1] for more deails. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With recent changes to smb.conf[1], smb2.session.reauth4 is expected to fail on CephFS kclient method. Refer [1] for more details. Also remember that this is not a problem with CephFS vfs approach but our clone of selftest mechanism currently lacks the ability to consider flapping lists based on variants for a particular backend. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With certain samba configurations we might require a separate flapping list for variants of a backend. One such situation is detailed in [1] where specific test run results differ among variants of a particular backend. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With recent changes to smb.conf[1] smb2.session.reauth4 is expected to fail on XFS. Refer [1] for more deails. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
With recent changes to smb.conf[1], smb2.session.reauth4 is expected to fail on CephFS kclient method. Refer [1] for more details. Also remember that this is not a problem with CephFS vfs approach but our clone of selftest mechanism currently lacks the ability to consider flapping lists based on variants for a particular backend. [1] samba-in-kubernetes/sit-environment#109 Signed-off-by: Anoop C S <[email protected]>
Following changes are made:
We introduce a temporary workaround to allow smbd to assume cap_dac_override when operating as root until official fixes are available.