vfs-security-rework-inode_getsecurity-and-callers-to
commitbee79cd1e2bbe3f322e776e57b93700c047a4789
authorDavid P. Quigley <dpquigl@tycho.nsa.gov>
Thu, 1 Nov 2007 19:29:22 +0000 (1 19:29 +0000)
committerMatthias Urlichs <smurf@hera.kernel.org>
Wed, 14 Nov 2007 11:28:14 +0000 (14 11:28 +0000)
tree0e9dd6901c1c69881d5e235db7d6da1553ae3010
parent33f703613886a265c0b060cb9ab82f729006e6a7
vfs-security-rework-inode_getsecurity-and-callers-to

This patch modifies the interface to inode_getsecurity to have the function
return a buffer containing the security blob and its length via parameters
instead of relying on the calling function to give it an appropriately sized
buffer.

Security blobs obtained with this function should be freed using the
release_secctx LSM hook.  This alleviates the problem of the caller having to
guess a length and preallocate a buffer for this function allowing it to be
used elsewhere for Labeled NFS.

The patch also removed the unused err parameter.  The conversion is similar to
the one performed by Al Viro for the security_getprocattr hook.

Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: James Morris <jmorris@namei.org>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: Casey Schaufler <casey@schaufler-ca.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/xattr.c
include/linux/security.h
include/linux/xattr.h
mm/shmem.c
security/dummy.c
security/security.c
security/selinux/hooks.c