From: Casey Schaufler <casey@schaufler-ca.com>
To: James Morris <jmorris@namei.org>,
"David P. Quigley" <dpquigl@tycho.nsa.gov>
Cc: Labeled NFS <labeled-nfs@linux-nfs.org>, selinux@tycho.nsa.gov
Subject: Re: [Labeled-nfs] [PATCH 08/13] NFS: Introduce lifecycle managment for label attribute.
Date: Mon, 19 Nov 2007 08:00:11 -0800 (PST) [thread overview]
Message-ID: <967921.55654.qm@web36602.mail.mud.yahoo.com> (raw)
In-Reply-To: <Xine.LNX.4.64.0711192226180.20955@us.intercode.com.au>
--- James Morris <jmorris@namei.org> wrote:
> On Fri, 16 Nov 2007, David P. Quigley wrote:
>
>
> > +#ifdef CONFIG_SECURITY
> > +#define nfs_fattr_alloc(fattr) \
> > +{ \
> > + (fattr)->label = kmalloc(NFS_MAXLABELLEN, GFP_ATOMIC); \
> > + (fattr)->label_len = NFS_MAXLABELLEN; \
> > + memset((fattr)->label, 0, NFS_MAXLABELLEN); \
> > +}
>
> These should be normal functions, perhaps in their own file which is
> conditionally built (and containing other label-specific code).
>
> You need to check the return of kmalloc().
>
> I suggest passing a gfp_t parameter to the allocation function to allow
> the caller to determine the allocation flags (unless you know it will
> always be GFP_ATOMIC).
>
> Use kzalloc() instead of kmalloc() + memset().
>
> It seems wasteful to always allocate the maximum sized label.
You could have a look at the smack_import() scheme. If you're
looking at a gazillion enormous, short lived labels on a system
it would be a bad choice, but even if you're labeling every file
differently (please say you're not) you may find it a better
mechanism. Your label lifecycle management issues go "poof".
Just a thought.
Casey Schaufler
casey@schaufler-ca.com
--
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.
next prev parent reply other threads:[~2007-11-19 16:00 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-16 20:03 [RFC Labeled NFS] Labeling support for NFSv4 David P. Quigley
2007-11-16 20:05 ` [PATCH 01/13] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer David P. Quigley
2007-11-16 20:06 ` [PATCH 02/13] VFS: Reorder vfs_getxattr to avoid unnecessary calls to the LSM David P. Quigley
2007-11-16 20:07 ` [PATCH 03/13] Security: Add hook to get full security xattr name David P. Quigley
2007-11-17 0:34 ` Casey Schaufler
2007-11-19 14:42 ` David P. Quigley
2007-11-16 20:07 ` [PATCH 04/13] VFS: Add label field to the iattr structure David P. Quigley
2007-11-16 20:08 ` [PATCH 05/13] Security: Add hook to calculate context based on a negative dentry David P. Quigley
2007-11-16 20:08 ` [PATCH 06/13] KConfig: Add KConfig entries for SELinux labeled NFS David P. Quigley
2007-11-16 20:09 ` [PATCH 07/13] NFSv4: Add label recommended attribute and NFSv4 flags David P. Quigley
2007-11-16 20:10 ` [PATCH 08/13] NFS: Introduce lifecycle managment for label attribute David P. Quigley
2007-11-19 11:33 ` [Labeled-nfs] " James Morris
2007-11-19 16:00 ` Casey Schaufler [this message]
[not found] ` <4741C77D.9080209@sparta.com>
2007-11-19 21:44 ` James Morris
2007-11-16 20:11 ` [PATCH 09/13] NFS: Client implementation of SELINUX Labeling David P. Quigley
2007-11-19 11:44 ` [Labeled-nfs] " James Morris
2007-11-16 20:11 ` [PATCH 10/13] NFS: Extend nfs xattr handlers to accept the security namespace David P. Quigley
2007-11-16 20:12 ` [PATCH 11/13] NFSD: Server implementation of MAC Labeling David P. Quigley
2007-11-16 20:12 ` [PATCH 12/13] NFS: Label change notification for NFSv4 Clients David P. Quigley
2007-11-16 20:13 ` [PATCH 13/13] NFSD: Label change notification for NFSv4 Server David P. Quigley
2007-11-16 20:56 ` [RFC Labeled NFS] Labeling support for NFSv4 Peter Staubach
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=967921.55654.qm@web36602.mail.mud.yahoo.com \
--to=casey@schaufler-ca.com \
--cc=dpquigl@tycho.nsa.gov \
--cc=jmorris@namei.org \
--cc=labeled-nfs@linux-nfs.org \
--cc=selinux@tycho.nsa.gov \
/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.