All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kyle Moffett <kyle@moffetthome.net>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Casey Schaufler <casey@schaufler-ca.com>,
	"David P. Quigley" <dpquigl@tycho.nsa.gov>,
	James Morris <jmorris@namei.org>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	hch@infradead.org, viro@zeniv.linux.org.uk,
	matthew.dodd@sparta.com, trond.myklebust@fys.uio.no,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH 06/10] NFSv4: Add label recommended attribute and NFSv4  flags
Date: Fri, 16 Jul 2010 20:09:23 -0400	[thread overview]
Message-ID: <AANLkTimBkFfkNmh8Rn3IH1ktGixUxQY8LPP56_joA93S@mail.gmail.com> (raw)
In-Reply-To: <1278945396.5221.14.camel@moss-pluto.epoch.ncsc.mil>

On Mon, Jul 12, 2010 at 10:36, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On Sat, 2010-07-10 at 22:12 -0700, Casey Schaufler wrote:
>> Kyle Moffett wrote:
>> > ...
>> > Even in local filesystems like ext3 we prefer to turn labels into
>> > numbers, store the number with each inode, and then keep the labels
>> > indexed in a separate datastructure.
>> >
>>
>> I don't know what system you're talking about, but that notion
>> was pretty well dispelled in the late 1980's, after the SystemV/MLS
>> and SecureWare examples.
>
> SELinux did that too before switching to using xattrs for label storage.
> Persistent security identifier (PSID) associated with each inode (either
> stored directly in the inode in the original kernel patches or
> associated through a separate mapping in the LSM-based implementation),
> with a mapping from PSID to context stored in a mapping within each
> filesystem.  Allowed you to keep the labels with the volume but avoided
> storing the same label multiple times.
>
> The xattr based implementation can sometimes share storage but only when
> the xattr is stored in the additional block (not when they are stored
> inline) and only if all of the xattrs on the file are identical.

Hmm, for some reason I was still thinking that we stored an encoded
form of the label even in xattrs.  Whoops!

On the other hand, I guess it should be noted that the "common" case
of an SELinux label is the inline storage case, labels are on average
no more than ~40 bytes:
  system_u:object_r:sysadm_homedir_t:s0

In filesystems that are space optimized (like squashfs), we still
prefer to pack xattrs, symlinks, and even file permissions as tightly
as possible through table lookups of various forms.  Heck, the
read-only squashfs only stores a single empty-directory inode and
references it wherever needed.

On the other hand, if you're doing something completely silly with 64k
labels then any hope of inline storage went out the window along with
any space savings from nifty FS optimizations like de-duplication or
tail-packing.

Cheers,
Kyle Moffett

WARNING: multiple messages have this Message-ID (diff)
From: Kyle Moffett <kyle-hoO6YkzgTuCM0SS3m2neIg@public.gmane.org>
To: Stephen Smalley <sds-+05T5uksL2qpZYMLLGbcSA@public.gmane.org>
Cc: Casey Schaufler <casey-iSGtlc1asvQWG2LlvL+J4A@public.gmane.org>,
	"David P. Quigley"
	<dpquigl-+05T5uksL2qpZYMLLGbcSA@public.gmane.org>,
	James Morris <jmorris-gx6/JNMH7DfYtjvyW6yDsg@public.gmane.org>,
	"J. Bruce Fields"
	<bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>,
	hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
	matthew.dodd-DABiIiYg7OfQT0dZR+AlfA@public.gmane.org,
	trond.myklebust-41N18TsMXrtuMpJDpNschA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	selinux-+05T5uksL2qpZYMLLGbcSA@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 06/10] NFSv4: Add label recommended attribute and NFSv4 flags
Date: Fri, 16 Jul 2010 20:09:23 -0400	[thread overview]
Message-ID: <AANLkTimBkFfkNmh8Rn3IH1ktGixUxQY8LPP56_joA93S@mail.gmail.com> (raw)
In-Reply-To: <1278945396.5221.14.camel-i1KelmKhlFUEBZ0NE5PZeDSSxhlBfLG+Zkel5v8DVj8@public.gmane.org>

On Mon, Jul 12, 2010 at 10:36, Stephen Smalley <sds-+05T5uksL2qpZYMLLGbcSA@public.gmane.org> wrote:
> On Sat, 2010-07-10 at 22:12 -0700, Casey Schaufler wrote:
>> Kyle Moffett wrote:
>> > ...
>> > Even in local filesystems like ext3 we prefer to turn labels into
>> > numbers, store the number with each inode, and then keep the labels
>> > indexed in a separate datastructure.
>> >
>>
>> I don't know what system you're talking about, but that notion
>> was pretty well dispelled in the late 1980's, after the SystemV/MLS
>> and SecureWare examples.
>
> SELinux did that too before switching to using xattrs for label storage.
> Persistent security identifier (PSID) associated with each inode (either
> stored directly in the inode in the original kernel patches or
> associated through a separate mapping in the LSM-based implementation),
> with a mapping from PSID to context stored in a mapping within each
> filesystem.  Allowed you to keep the labels with the volume but avoided
> storing the same label multiple times.
>
> The xattr based implementation can sometimes share storage but only when
> the xattr is stored in the additional block (not when they are stored
> inline) and only if all of the xattrs on the file are identical.

Hmm, for some reason I was still thinking that we stored an encoded
form of the label even in xattrs.  Whoops!

On the other hand, I guess it should be noted that the "common" case
of an SELinux label is the inline storage case, labels are on average
no more than ~40 bytes:
  system_u:object_r:sysadm_homedir_t:s0

In filesystems that are space optimized (like squashfs), we still
prefer to pack xattrs, symlinks, and even file permissions as tightly
as possible through table lookups of various forms.  Heck, the
read-only squashfs only stores a single empty-directory inode and
references it wherever needed.

On the other hand, if you're doing something completely silly with 64k
labels then any hope of inline storage went out the window along with
any space savings from nifty FS optimizations like de-duplication or
tail-packing.

Cheers,
Kyle Moffett
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Kyle Moffett <kyle@moffetthome.net>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Casey Schaufler <casey@schaufler-ca.com>,
	"David P. Quigley" <dpquigl@tycho.nsa.gov>,
	James Morris <jmorris@namei.org>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	hch@infradead.org, viro@zeniv.linux.org.uk,
	matthew.dodd@sparta.com, trond.myklebust@fys.uio.no,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH 06/10] NFSv4: Add label recommended attribute and NFSv4 flags
Date: Fri, 16 Jul 2010 20:09:23 -0400	[thread overview]
Message-ID: <AANLkTimBkFfkNmh8Rn3IH1ktGixUxQY8LPP56_joA93S@mail.gmail.com> (raw)
In-Reply-To: <1278945396.5221.14.camel@moss-pluto.epoch.ncsc.mil>

On Mon, Jul 12, 2010 at 10:36, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On Sat, 2010-07-10 at 22:12 -0700, Casey Schaufler wrote:
>> Kyle Moffett wrote:
>> > ...
>> > Even in local filesystems like ext3 we prefer to turn labels into
>> > numbers, store the number with each inode, and then keep the labels
>> > indexed in a separate datastructure.
>> >
>>
>> I don't know what system you're talking about, but that notion
>> was pretty well dispelled in the late 1980's, after the SystemV/MLS
>> and SecureWare examples.
>
> SELinux did that too before switching to using xattrs for label storage.
> Persistent security identifier (PSID) associated with each inode (either
> stored directly in the inode in the original kernel patches or
> associated through a separate mapping in the LSM-based implementation),
> with a mapping from PSID to context stored in a mapping within each
> filesystem.  Allowed you to keep the labels with the volume but avoided
> storing the same label multiple times.
>
> The xattr based implementation can sometimes share storage but only when
> the xattr is stored in the additional block (not when they are stored
> inline) and only if all of the xattrs on the file are identical.

Hmm, for some reason I was still thinking that we stored an encoded
form of the label even in xattrs.  Whoops!

On the other hand, I guess it should be noted that the "common" case
of an SELinux label is the inline storage case, labels are on average
no more than ~40 bytes:
  system_u:object_r:sysadm_homedir_t:s0

In filesystems that are space optimized (like squashfs), we still
prefer to pack xattrs, symlinks, and even file permissions as tightly
as possible through table lookups of various forms.  Heck, the
read-only squashfs only stores a single empty-directory inode and
references it wherever needed.

On the other hand, if you're doing something completely silly with 64k
labels then any hope of inline storage went out the window along with
any space savings from nifty FS optimizations like de-duplication or
tail-packing.

Cheers,
Kyle Moffett


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

WARNING: multiple messages have this Message-ID (diff)
From: Kyle Moffett <kyle@moffetthome.net>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Casey Schaufler <casey@schaufler-ca.com>,
	"David P. Quigley" <dpquigl@tycho.nsa.gov>,
	James Morris <jmorris@namei.org>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	hch@infradead.org, viro@zeniv.linux.org.uk,
	matthew.dodd@sparta.com, trond.myklebust@fys.uio.no,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH 06/10] NFSv4: Add label recommended attribute and NFSv4 flags
Date: Fri, 16 Jul 2010 20:09:23 -0400	[thread overview]
Message-ID: <AANLkTimBkFfkNmh8Rn3IH1ktGixUxQY8LPP56_joA93S@mail.gmail.com> (raw)
In-Reply-To: <1278945396.5221.14.camel@moss-pluto.epoch.ncsc.mil>

On Mon, Jul 12, 2010 at 10:36, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On Sat, 2010-07-10 at 22:12 -0700, Casey Schaufler wrote:
>> Kyle Moffett wrote:
>> > ...
>> > Even in local filesystems like ext3 we prefer to turn labels into
>> > numbers, store the number with each inode, and then keep the labels
>> > indexed in a separate datastructure.
>> >
>>
>> I don't know what system you're talking about, but that notion
>> was pretty well dispelled in the late 1980's, after the SystemV/MLS
>> and SecureWare examples.
>
> SELinux did that too before switching to using xattrs for label storage.
> Persistent security identifier (PSID) associated with each inode (either
> stored directly in the inode in the original kernel patches or
> associated through a separate mapping in the LSM-based implementation),
> with a mapping from PSID to context stored in a mapping within each
> filesystem.  Allowed you to keep the labels with the volume but avoided
> storing the same label multiple times.
>
> The xattr based implementation can sometimes share storage but only when
> the xattr is stored in the additional block (not when they are stored
> inline) and only if all of the xattrs on the file are identical.

Hmm, for some reason I was still thinking that we stored an encoded
form of the label even in xattrs.  Whoops!

On the other hand, I guess it should be noted that the "common" case
of an SELinux label is the inline storage case, labels are on average
no more than ~40 bytes:
  system_u:object_r:sysadm_homedir_t:s0

In filesystems that are space optimized (like squashfs), we still
prefer to pack xattrs, symlinks, and even file permissions as tightly
as possible through table lookups of various forms.  Heck, the
read-only squashfs only stores a single empty-directory inode and
references it wherever needed.

On the other hand, if you're doing something completely silly with 64k
labels then any hope of inline storage went out the window along with
any space savings from nifty FS optimizations like de-duplication or
tail-packing.

Cheers,
Kyle Moffett

  reply	other threads:[~2010-07-17  0:09 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 14:31 Labeled-NFS: Security Label support in NFSv4 David P. Quigley
2010-07-07 14:31 ` David P. Quigley
2010-07-07 14:31 ` [PATCH 01/10] Security: Add hook to calculate context based on a negative dentry David P. Quigley
2010-07-07 14:31   ` David P. Quigley
2010-07-08 12:51   ` Stephen Smalley
2010-07-08 12:51     ` Stephen Smalley
2010-07-07 14:31 ` [PATCH 02/10] Security: Add Hook to test if the particular xattr is part of a MAC model David P. Quigley
2010-07-07 14:31   ` David P. Quigley
2010-07-07 16:49   ` J. Bruce Fields
2010-07-07 16:49     ` J. Bruce Fields
2010-07-07 14:31 ` [PATCH 03/10] LSM: Add flags field to security_sb_set_mnt_opts for in kernel mount data David P. Quigley
2010-07-07 14:31   ` David P. Quigley
2010-07-07 14:31 ` [PATCH 04/10] SELinux: Add new labeling type native labels David P. Quigley
2010-07-07 14:31   ` David P. Quigley
2010-07-07 23:23   ` James Morris
2010-07-07 23:23     ` James Morris
2010-07-08 13:31     ` David P. Quigley
2010-07-08 13:31       ` David P. Quigley
2010-07-08 22:33       ` James Morris
2010-07-08 22:33         ` James Morris
2010-07-09 14:09         ` David P. Quigley
2010-07-09 14:09           ` David P. Quigley
2010-07-07 14:31 ` [PATCH 05/10] KConfig: Add KConfig entries for Labeled NFS David P. Quigley
2010-07-07 14:31   ` David P. Quigley
2010-07-07 16:56   ` J. Bruce Fields
2010-07-07 16:56     ` J. Bruce Fields
2010-07-07 17:05     ` David P. Quigley
2010-07-07 17:05       ` David P. Quigley
2010-07-07 17:05       ` David P. Quigley
2010-07-07 17:53     ` Chuck Lever
2010-07-07 17:53       ` Chuck Lever
2010-07-07 14:31 ` [PATCH 06/10] NFSv4: Add label recommended attribute and NFSv4 flags David P. Quigley
2010-07-07 14:31   ` David P. Quigley
2010-07-07 17:00   ` J. Bruce Fields
2010-07-07 23:30     ` James Morris
2010-07-07 23:30       ` James Morris
2010-07-08 13:39       ` David P. Quigley
2010-07-08 13:39         ` David P. Quigley
2010-07-08 13:39         ` David P. Quigley
2010-07-08 13:39         ` David P. Quigley
2010-07-08 22:48         ` James Morris
2010-07-08 22:48           ` James Morris
2010-07-09 13:47           ` Stephen Smalley
2010-07-09 13:47             ` Stephen Smalley
2010-07-09 13:47             ` Stephen Smalley
2010-07-09 14:05           ` David P. Quigley
2010-07-09 14:05             ` David P. Quigley
2010-07-09 14:05             ` David P. Quigley
2010-07-11  5:02             ` Kyle Moffett
2010-07-11  5:02               ` Kyle Moffett
2010-07-11  5:02               ` Kyle Moffett
2010-07-11  5:02               ` Kyle Moffett
2010-07-11  5:12               ` Casey Schaufler
2010-07-11  5:12                 ` Casey Schaufler
2010-07-11  5:12                 ` Casey Schaufler
2010-07-12 14:36                 ` Stephen Smalley
2010-07-12 14:36                   ` Stephen Smalley
2010-07-17  0:09                   ` Kyle Moffett [this message]
2010-07-17  0:09                     ` Kyle Moffett
2010-07-17  0:09                     ` Kyle Moffett
2010-07-17  0:09                     ` Kyle Moffett
2010-07-07 14:31 ` [PATCH 07/10] NFSv4: Introduce new label structure David P. Quigley
2010-07-07 14:31   ` David P. Quigley
2010-07-07 16:01   ` Chuck Lever
2010-07-07 16:21     ` Casey Schaufler
2010-07-07 16:21       ` Casey Schaufler
2010-07-07 16:21       ` Casey Schaufler
2010-07-07 16:24       ` David P. Quigley
2010-07-07 16:24         ` David P. Quigley
2010-07-07 16:24         ` David P. Quigley
2010-07-07 17:42       ` Chuck Lever
2010-07-07 17:42         ` Chuck Lever
2010-07-07 16:22     ` David P. Quigley
2010-07-07 16:22       ` David P. Quigley
2010-07-07 16:22       ` David P. Quigley
2010-07-07 17:49       ` Chuck Lever
2010-07-07 18:11         ` David P. Quigley
2010-07-07 18:11           ` David P. Quigley
2010-07-07 14:31 ` [PATCH 08/10] NFS: Client implementation of Labeled-NFS David P. Quigley
2010-07-07 14:31   ` David P. Quigley
2010-07-07 14:31 ` [PATCH 09/10] NFS: Extend NFS xattr handlers to accept the security namespace David P. Quigley
2010-07-07 14:31   ` David P. Quigley
2010-07-07 14:31 ` [PATCH 10/10] NFSD: Server implementation of MAC Labeling David P. Quigley
2010-07-07 14:31   ` David P. Quigley
2010-07-07 17:21   ` J. Bruce Fields
2010-07-07 18:03     ` David P. Quigley
2010-07-07 18:03       ` David P. Quigley
2010-07-07 18:03       ` David P. Quigley
2010-07-07 19:24       ` J. Bruce Fields
2010-07-08 13:27         ` David P. Quigley
2010-07-08 13:27           ` David P. Quigley
  -- strict thread matches above, loose matches on Subject: below --
2010-06-08 16:22 Labeled-NFS: Security Label support in NFSv4 David P. Quigley
2010-06-08 16:22 ` [PATCH 06/10] NFSv4: Add label recommended attribute and NFSv4 flags David P. Quigley
2010-06-08 16:22   ` David P. Quigley
2010-06-08 16:22   ` David P. Quigley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimBkFfkNmh8Rn3IH1ktGixUxQY8LPP56_joA93S@mail.gmail.com \
    --to=kyle@moffetthome.net \
    --cc=bfields@fieldses.org \
    --cc=casey@schaufler-ca.com \
    --cc=dpquigl@tycho.nsa.gov \
    --cc=hch@infradead.org \
    --cc=jmorris@namei.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=matthew.dodd@sparta.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=trond.myklebust@fys.uio.no \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.