Skip to content

Commit 0fbe8f5

Browse files
Daniel Jurgensdledford
authored andcommitted
IB/core: Don't enforce PKey security on SMI MADs
Per the infiniband spec an SMI MAD can have any PKey. Checking the pkey on SMI MADs is not necessary, and it seems that some older adapters using the mthca driver don't follow the convention of using the default PKey, resulting in false denials, or errors querying the PKey cache. SMI MAD security is still enforced, only agents allowed to manage the subnet are able to receive or send SMI MADs. Reported-by: Chris Blake <[email protected]> Cc: <[email protected]> # v4.12 Fixes: 47a2b33 ("IB/core: Enforce security on management datagrams") Signed-off-by: Daniel Jurgens <[email protected]> Reviewed-by: Parav Pandit <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 4cae8ff commit 0fbe8f5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/infiniband/core/security.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,11 @@ int ib_mad_enforce_security(struct ib_mad_agent_private *map, u16 pkey_index)
739739
if (!rdma_protocol_ib(map->agent.device, map->agent.port_num))
740740
return 0;
741741

742-
if (map->agent.qp->qp_type == IB_QPT_SMI && !map->agent.smp_allowed)
743-
return -EACCES;
742+
if (map->agent.qp->qp_type == IB_QPT_SMI) {
743+
if (!map->agent.smp_allowed)
744+
return -EACCES;
745+
return 0;
746+
}
744747

745748
return ib_security_pkey_access(map->agent.device,
746749
map->agent.port_num,

0 commit comments

Comments
 (0)