All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC]Cleanup inode_getsecurity and callers for use with labeled NFS
@ 2007-08-17 17:01 David P. Quigley
  2007-08-17 17:01 ` [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer David P. Quigley
  2007-08-17 17:01 ` [PATCH 2/2] VFS: Reorder vfs_getxattr to avoid unnecessary calls to the LSM David P. Quigley
  0 siblings, 2 replies; 29+ messages in thread
From: David P. Quigley @ 2007-08-17 17:01 UTC (permalink / raw)
  To: jmorris; +Cc: selinux

These patches modify inode_getsecurity and its callers to use the format
similar to the one used by getprocattr which was proposed by Al Viro. They
also rework vfs_getxattr to avoid unnecessary calls to the LSM. These patches
are to support the ongoing work on Labeled NFS.

The first patch converts inode_getsecurity to return the security blob via a
parameter and the length of the blob via the function's return value. This
removes the need for the called to guess the length of the security blob. The
patch also removed the unused err parameter. All of the callers are updated to
use a helper function named xattr_getsecurity which keeps the xattr style
interface and performs generic checks which were originally in the security
modules.

The second patch reworks vfs_getxattr to unconditionally call to the LSM in
the case that we are requesting a security namespace attribute. Originally we
would grab the value from disk then clobber it with the one from the LSM. This
way we can grab it directly from the LSM and in the case when there is no
module loaded or it does not support inode_getsecurity we fall back on the
inode getxattr operation.

David Quigley



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

^ permalink raw reply	[flat|nested] 29+ messages in thread
* [RFC 0/2] getsecurity/vfs_getxattr cleanup
@ 2007-10-22 19:06 David P. Quigley
  2007-10-22 19:10 ` [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer David P. Quigley
  0 siblings, 1 reply; 29+ messages in thread
From: David P. Quigley @ 2007-10-22 19:06 UTC (permalink / raw)
  To: linux-security-module, linux-fsdevel, jmorris, sds

This patch series addresses two concerns. Currently when a developer
wishes to obtain a security blob from the LSM he/she has to guess at the
length of the blob being returned. We modify security_inode_getsecurity
to return an appropriately sized buffer populated with the security
information and the length of that buffer. This is similar to the
approach taken by Al Viro for the security_getprocattr hook. 

The second concern that this patch set addresses is that vfs_getxattr
reads the security xattr using inode_getxattr and then proceeds to
clobber it with a subsequent call to the LSM. This is fixed by
reordering vfs_getxattr.

The series applies on top of 2.6.23 aka git hash
bbf25010f1a6b761914430f5fca081ec8c7accd1


^ permalink raw reply	[flat|nested] 29+ messages in thread
* [PATCH 0/2] getsecurity/vfs_getxattr cleanup V2
@ 2007-11-01 14:35 David P. Quigley
  2007-11-01 14:40 ` [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer David P. Quigley
  0 siblings, 1 reply; 29+ messages in thread
From: David P. Quigley @ 2007-11-01 14:35 UTC (permalink / raw)
  To: linux-security-module, linux-fsdevel, jmorris, sds, serue, akpm

This patch series addresses two concerns. Currently when a developer
wishes to obtain a security blob from the LSM he/she has to guess at the
length of the blob being returned. We modify security_inode_getsecurity
to return an appropriately sized buffer populated with the security
information and the length of that buffer. This is similar to the
approach taken by Al Viro for the security_getprocattr hook. 

The second concern that this patch set addresses is that vfs_getxattr
reads the security xattr using inode_getxattr and then proceeds to
clobber it with a subsequent call to the LSM. This is fixed by
reordering vfs_getxattr.

The difference between this patch and version one can be seen in two places.
As per James Morris's suggestion function declarations that were split into
multiple lines because they were larger than 80 characters in length have been
merged into one line. Second as per Serge's comments security_inode_getsecurity
and the LSM hook inode_getsecurity take a bool to indicate if the function
should allocate the buffer and return the length or just return the length.  

This patch should apply on top of 2.6.24-rc1 and will definitely apply on git
commit hash ec3b67c11df42362ccda81261d62829042f223f0

If all concerns have been addressed I would propose the patches be added into -mm.


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2007-11-01 22:43 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-17 17:01 [RFC]Cleanup inode_getsecurity and callers for use with labeled NFS David P. Quigley
2007-08-17 17:01 ` [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer David P. Quigley
2007-08-17 19:37   ` Casey Schaufler
2007-08-17 19:46     ` David P. Quigley
2007-08-17 19:58     ` David P. Quigley
2007-08-17 21:21       ` Casey Schaufler
2007-08-27 19:05         ` David P. Quigley
2007-08-27 19:51           ` Casey Schaufler
2007-08-17 17:01 ` [PATCH 2/2] VFS: Reorder vfs_getxattr to avoid unnecessary calls to the LSM David P. Quigley
  -- strict thread matches above, loose matches on Subject: below --
2007-10-22 19:06 [RFC 0/2] getsecurity/vfs_getxattr cleanup David P. Quigley
2007-10-22 19:10 ` [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer David P. Quigley
2007-10-23 23:38   ` James Morris
2007-10-26  0:02   ` Serge E. Hallyn
2007-10-26 14:50     ` David P. Quigley
2007-10-26 15:02       ` Serge E. Hallyn
2007-10-26 15:04         ` Stephen Smalley
2007-10-26 15:35           ` Serge E. Hallyn
2007-10-26 15:13         ` David P. Quigley
2007-10-26 15:20           ` David P. Quigley
2007-10-26 15:54         ` David P. Quigley
2007-10-26 16:36           ` Serge E. Hallyn
2007-10-26 17:36             ` David P. Quigley
2007-10-26 15:07       ` Serge E. Hallyn
2007-10-26 15:16         ` David P. Quigley
2007-10-26 22:14         ` James Morris
2007-10-31 20:55           ` David P. Quigley
2007-11-01  3:56             ` James Morris
2007-11-01 14:35 [PATCH 0/2] getsecurity/vfs_getxattr cleanup V2 David P. Quigley
2007-11-01 14:40 ` [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer David P. Quigley
2007-11-01 20:58   ` James Morris
2007-11-01 22:43   ` Serge E. Hallyn

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.