summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2023-02-08 01:33:31 +0300
committerPaul Moore <paul@paul-moore.com>2023-03-06 21:41:07 +0300
commit36819f185590c1e0e47d095f04bf5da20650fe4d (patch)
treeab11ea6f9d6f1031a7dd46460037ce88c7a78f56 /security
parent1661372c912d1966e21e0cb5463559984df8249b (diff)
downloadlinux-36819f185590c1e0e47d095f04bf5da20650fe4d.tar.xz
lsm: move the fs_context hook comments to security/security.c
This patch relocates the LSM hook function comments to the function definitions, in keeping with the current kernel conventions. This should make the hook descriptions more easily discoverable and easier to maintain. While formatting changes have been done to better fit the kernel-doc style, content changes have been kept to a minimum and limited to text which was obviously incorrect and/or outdated. It is expected the future patches will improve the quality of the function header comments. Acked-by: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security')
-rw-r--r--security/security.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/security/security.c b/security/security.c
index 1e7dbaf9ad28..64c8805570b1 100644
--- a/security/security.c
+++ b/security/security.c
@@ -979,11 +979,34 @@ void security_bprm_committed_creds(struct linux_binprm *bprm)
call_void_hook(bprm_committed_creds, bprm);
}
+/**
+ * security_fs_context_dup() - Duplicate a fs_context LSM blob
+ * @fc: destination filesystem context
+ * @src_fc: source filesystem context
+ *
+ * Allocate and attach a security structure to sc->security. This pointer is
+ * initialised to NULL by the caller. @fc indicates the new filesystem context.
+ * @src_fc indicates the original filesystem context.
+ *
+ * Return: Returns 0 on success or a negative error code on failure.
+ */
int security_fs_context_dup(struct fs_context *fc, struct fs_context *src_fc)
{
return call_int_hook(fs_context_dup, 0, fc, src_fc);
}
+/**
+ * security_fs_context_parse_param() - Configure a filesystem context
+ * @fc: filesystem context
+ * @param: filesystem parameter
+ *
+ * Userspace provided a parameter to configure a superblock. The LSM can
+ * consume the parameter or return it to the caller for use elsewhere.
+ *
+ * Return: If the parameter is used by the LSM it should return 0, if it is
+ * returned to the caller -ENOPARAM is returned, otherwise a negative
+ * error code is returned.
+ */
int security_fs_context_parse_param(struct fs_context *fc,
struct fs_parameter *param)
{