diff options
author | Daniel Jurgens <danielj@mellanox.com> | 2017-05-19 15:48:54 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-05-23 19:27:21 +0300 |
commit | 47a2b338fe63200d716d2e24131cdb49f17c77da (patch) | |
tree | 2214ac893b108716acf44eb4098686fc34e48b03 /include/rdma/ib_mad.h | |
parent | 8f408ab64be6319cb7736cbc6982838dcc362306 (diff) | |
download | linux-47a2b338fe63200d716d2e24131cdb49f17c77da.tar.xz |
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>
Acked-by: Doug Ledford <dledford@redhat.com>
[PM: remove the LSM hook init code]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'include/rdma/ib_mad.h')
-rw-r--r-- | include/rdma/ib_mad.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h index d67b11b72029..2f4f1768ded4 100644 --- a/include/rdma/ib_mad.h +++ b/include/rdma/ib_mad.h @@ -575,6 +575,10 @@ struct ib_mad_agent { u32 flags; u8 port_num; u8 rmpp_version; + void *security; + bool smp_allowed; + bool lsm_nb_reg; + struct notifier_block lsm_nb; }; /** |