mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
lsm: Move security_netlink_send to under CONFIG_SECURITY_NETWORK
security_netlink_send() is a networking hook, so it fits better under CONFIG_SECURITY_NETWORK. Signed-off-by: Song Liu <song@kernel.org> Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
@@ -4276,24 +4276,6 @@ int security_setprocattr(int lsmid, const char *name, void *value, size_t size)
|
||||
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, sk, skb);
|
||||
}
|
||||
|
||||
/**
|
||||
* security_ismaclabel() - Check if the named attribute is a MAC label
|
||||
* @name: full extended attribute name
|
||||
@@ -4483,6 +4465,24 @@ int security_watch_key(struct key *key)
|
||||
#endif /* CONFIG_KEY_NOTIFICATIONS */
|
||||
|
||||
#ifdef CONFIG_SECURITY_NETWORK
|
||||
/**
|
||||
* 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, sk, skb);
|
||||
}
|
||||
|
||||
/**
|
||||
* security_unix_stream_connect() - Check if a AF_UNIX stream is allowed
|
||||
* @sock: originating sock
|
||||
|
||||
Reference in New Issue
Block a user