Skip to contentSkip to conversation

SELinux and SID

DISCUSSION Mario Fanelli 3 participants 5 messages May 30, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

I read that SELinux uses extended attributes to maintain SID/file mapping, but I have a Fedora Core 5 with an ext3 filesystem but if I use getfattr command on any file I don't obtain nothing that resembles SID. Am I wrong?

Where does SELinux store SID?

#1 lore raw
Quoted 5 lines · Mario Fanelli

I read that SELinux uses extended attributes to maintain SID/file mapping, but I have a Fedora Core 5 with an ext3 filesystem but if I use getfattr command on any file I don’t obtain nothing that resembles SID. Am I wrong?

Where does SELinux store SID?

You have to tell it what attribute name you want

$ getfattr -n security.selinux .
# file: .
security.selinux="system_u:object_r:root_t:s0\000"

--
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
Quoted 7 lines · Joshua Brindle
Quoted 6 lines · Mario Fanelli

I read that SELinux uses extended attributes to maintain SID/file mapping, but I have a Fedora Core 5 with an ext3 filesystem but if I use getfattr command on any file I don’t obtain nothing that resembles SID. Am I wrong?

Quoted 7 lines
Quoted 2 lines

Where does SELinux store SID?

You have to tell it what attribute name you want

$ getfattr -n security.selinux .
# file: .
security.selinux="system_u:object_r:root_t:s0\000"

Note btw that security context strings are stored on the filesystem, not the (non-persistent non-global) SIDs (which are only stored in the in-core inodes). Older versions of SELinux (pre-2.6) stored a separate persistent SID in the on-disk inodes (with a per-fs mapping from persistent SIDs to contexts), but that was eliminated when we migrated to using xattrs.

getfattr only displays attributes in the user namespace by default. To display all attributes on a file, you'd do something like:

$ getfattr -m "" -d /path/to/file

Or to see attribute in just the security namespace:

$ getfattr -m "^security" -d /path/to/file
Signature · 8 lines
Stephen Smalley
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.
#3 lore raw

R: SELinux and SID

Quoted 33 lines

-----Messaggio originale-----
Da: Stephen Smalley [mailto:[email protected]]
Inviato: Tuesday, May 30, 2006 5:41 PM
A: Joshua Brindle
Cc: Mario Fanelli; SeLinux Mailing List
Oggetto: Re: SELinux and SID

Quoted 8 lines · Joshua Brindle
Quoted 7 lines · Mario Fanelli

I read that SELinux uses extended attributes to maintain SID/file mapping, but I have a Fedora Core 5 with an ext3 filesystem but if I
use getfattr command on any file I don't obtain nothing thatresembles

SID. Am I wrong?

Quoted 7 lines
Quoted 2 lines

Where does SELinux store SID?

You have to tell it what attribute name you want

$ getfattr -n security.selinux .
# file: .
security.selinux="system_u:object_r:root_t:s0\000"

Note btw that security context strings are stored on the filesystem, not the (non-persistent non-global) SIDs (which are only stored in the in-core inodes). Older versions of SELinux (pre-2.6) stored a separate persistent SID in the on-disk inodes (with a per-fs mapping from persistent SIDs to contexts), but that was eliminated when we migrated to using xattrs.

Quoted 11 lines

getfattr only displays attributes in the user namespace by default. To display all attributes on a file, you'd do something like:

$ getfattr -m "" -d /path/to/file

Or to see attribute in just the security namespace:

$ getfattr -m "^security" -d /path/to/file
Signature · 3 lines
Stephen Smalley
National Security Agency
--

But are the SID invalidate to any reboot? If two object have the same security context, SID are equals?

--
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.

#4 lore raw

Re: R: SELinux and SID

Quoted 2 lines · Mario Fanelli

But are the SID invalidate to any reboot? If two object have the same security context, SID are equals?

A SID is an integer that refers to a security context. SIDs are dynamically allocated on demand, although there are a few preallocated ones for initialization. SIDs are not exported by the kernel to userspace; they are purely an in-kernel abstraction. Userspace object managers that need to enforce policy over their own objects and operations can also have their own private SID tables (supported by libselinux, as part of the userspace AVC).

Signature · 8 lines
Stephen Smalley
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.