aboutsummaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorDaniel Jurgens <danielj@mellanox.com>2017-05-19 15:48:54 +0300
committerPaul Moore <paul@paul-moore.com>2017-05-19 15:18:18 -0400
commit040838c51dbd68d02cdf06640a1e02f15f5b9c88 (patch)
tree2a6ef78f62960411351d9ce3f2a452764cb35260 /security
parent3ca3bcbc1565812fe12b452f66a9a8ef815c27ee (diff)
IB/core: Enforce security on management datagrams
Allocate and free a security context when creating and destroying a MAD agent. This context is used for controlling access to PKeys and sending and receiving SMPs. When sending or receiving a MAD check that the agent has permission to access the PKey for the Subnet Prefix of the port. During MAD and snoop agent registration for SMI QPs check that the calling process has permission to access the manage the subnet and register a callback with the LSM to be notified of policy changes. When notificaiton of a policy change occurs recheck permission and set a flag indicating sending and receiving SMPs is allowed. When sending and receiving MADs check that the agent has access to the SMI if it's on an SMI QP. Because security policy can change it's possible permission was allowed when creating the agent, but no longer is. Signed-off-by: Daniel Jurgens <danielj@mellanox.com> [PM: remove the LSM hook init code] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security')
-rw-r--r--security/security.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/security.c b/security/security.c
index a510af8f083f..b3b5929caec6 100644
--- a/security/security.c
+++ b/security/security.c
@@ -1540,6 +1540,12 @@ int security_ib_pkey_access(void *sec, u64 subnet_prefix, u16 pkey)
}
EXPORT_SYMBOL(security_ib_pkey_access);
+int security_ib_endport_manage_subnet(void *sec, const char *dev_name, u8 port_num)
+{
+ return call_int_hook(ib_endport_manage_subnet, 0, sec, dev_name, port_num);
+}
+EXPORT_SYMBOL(security_ib_endport_manage_subnet);
+
int security_ib_alloc_security(void **sec)
{
return call_int_hook(ib_alloc_security, 0, sec);