OSDN Git Service

lsm: move the netlink hook comments to security/security.c
authorPaul Moore <paul@paul-moore.com>
Sun, 12 Feb 2023 20:06:59 +0000 (15:06 -0500)
committerPaul Moore <paul@paul-moore.com>
Mon, 6 Mar 2023 18:41:07 +0000 (13:41 -0500)
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>
include/linux/lsm_hooks.h
security/security.c

index 5578a13..ba2daec 100644 (file)
 /**
  * union security_list_options - Linux Security Module hook function list
  *
- * Security hooks for Netlink messaging.
- *
- * @netlink_send:
- *     Save security information for a netlink message so that permission
- *     checking can be performed when the message is processed.  The security
- *     information can be saved using the eff_cap field of the
- *     netlink_skb_parms structure.  Also may be used to provide fine
- *     grained control over message transmission.
- *     @sk associated sock of task sending the message.
- *     @skb contains the sk_buff structure for the netlink message.
- *     Return 0 if the information was successfully saved and message
- *     is allowed to be transmitted.
- *
  * Security hooks for Unix domain networking.
  *
  * @unix_stream_connect:
index 766595a..b5fe49a 100644 (file)
@@ -3458,6 +3458,19 @@ int security_setprocattr(const char *lsm, const char *name, void *value,
        return LSM_RET_DEFAULT(setprocattr);
 }
 
+/**
+ * security_netlink_send() - Save info and check if netlink sending is allowed
+ * @sk: sending socket
+ * @skb: netlink message
+ *
+ * Save security information for a netlink message so that permission checking
+ * can be performed when the message is processed.  The security information
+ * can be saved using the eff_cap field of the netlink_skb_parms structure.
+ * Also may be used to provide fine grained control over message transmission.
+ *
+ * Return: Returns 0 if the information was successfully saved and message is
+ *         allowed to be transmitted.
+ */
 int security_netlink_send(struct sock *sk, struct sk_buff *skb)
 {
        return call_int_hook(netlink_send, 0, sk, skb);