Skip to contentSkip to conversation

Unionfs and Selinux

DISCUSSION Jaspreet Singh 3 participants 3 messages Jan 12, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi,

I am facing some problem using unionfs with selinux. Unionfs is available for linux from ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/

Unionfs redirects the listxattr /getxattr calls to underlying branches (of filesystems).

It works somewhat like this -

mount -t unionfs -o dirs=/a=rw:/b=ro none /n

ls -Z /a /b .. displays correct security contexts but ls -Z on the mount point /n .. displays none. Although the mount point /n has security context.

When I mentioned the following entry in fs_use.
fs_use_xattr unionfs system_u:object_r:fs_t;

It said :- mount: Operation not supported ,and audit says -
SELinux: (dev unionfs, type unionfs) has no xattr support

But IHMO it implements .. listxattr and getxattrs ... correctly.

A quick strace on mount .. showed that the kernel returned -EOPNOTSUPP

any clues ???

Regards,
Jaspreet

Signature · 4 lines
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw

i came across the same problem when implementing xattrs in fuse.

i have a vague recollection of using -o fscontext=somethingappropriate in order to over-ride the problem, although this is not ideal.

also - you _are_ returning xattrs "immediately", aren't you?

i.e. you're not doing what fuse does which is to send a -512 error code the name of which i forget but the effect of which is to tell the kernel to "come back later", are you?

selinux on lookup of xattrs cannot cope if you tell it to "come back later".

[the reason why fuse does that is to gain an opportunity to tell the
userspace program to wake up, query it, receive results, and when the kernel does "come back later", fuse has the answer]

Quoted 34 lines · Jaspreet Singh

Hi,

I am facing some problem using unionfs with selinux. Unionfs is available for linux from ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/

Unionfs redirects the listxattr /getxattr calls to underlying branches (of filesystems).

It works somewhat like this -

mount -t unionfs -o dirs=/a=rw:/b=ro none /n

ls -Z /a /b .. displays correct security contexts but ls -Z on the mount point /n .. displays none. Although the mount point /n has security context.

When I mentioned the following entry in fs_use.
fs_use_xattr unionfs system_u:object_r:fs_t;

It said :- mount: Operation not supported ,and audit says -
SELinux: (dev unionfs, type unionfs) has no xattr support

But IHMO it implements .. listxattr and getxattrs ... correctly.

A quick strace on mount .. showed that the kernel returned -EOPNOTSUPP

any clues ???

Regards,
Jaspreet

Signature · 8 lines
--
<a href="http://lkcl.net">http://lkcl.net</a>
--

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
In reply to Jaspreet Singh
Quoted 2 lines · Jaspreet Singh

Unionfs redirects the listxattr /getxattr calls to underlying branches (of filesystems).

Only if you build it with the UNIONFS_XATTR option enabled, which appears to be commented out by default in the Makefile. Did you build with it enabled?

Quoted 2 lines

It said :- mount: Operation not supported ,and audit says -
SELinux: (dev unionfs, type unionfs) has no xattr support

This means that the root inode had a NULL getxattr method at the time of the security_sb_kern_mount() hook call just after the type->get_sb() call in do_kern_mount().

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.