linux/drivers/infiniband/hw
Sebastian Sanchez 406310c66d IB/hfi1: Validate PKEY for incoming GSI MAD packets
These are the use-cases where the pkey needs to be tested to see
if a packet needs to be dropped.

a) Check if pkey is not FULL_MGMT_P_KEY or LIM_MGMT_P_KEY,
   drop the packet as it's not part of the management partition.
   Self-originated packets are an exception.

b) If pkey index points to FULL_MGMT_P_KEY and LIM_MGMT_P_KEY is
   in the table, the packet is coming from a management node,
   and the receiving node is also a management node, so it is safe
   for the packet to go through.

c) If pkey index points to FULL_MGMT_P_KEY and LIM_MGMT_P_KEY is
   NOT in the table, drop the packet as LIM_MGMT_P_KEY should
   always be in the pkey table. It could be a misconfiguration.

d) If pkey index points to LIM_MGMT_P_KEY and FULL_MGMT_P_KEY is
   NOT in the table, it is safe for the packet to go through
   since a non-management node is talking to another non-managment
   node.

e) If pkey index points to LIM_MGMT_P_KEY and FULL_MGMT_P_KEY is in
   the table, drop the packet because a non-management node is
   talking to a management node, and it could be an attack.

For the implementation, these rules can be simplied to only checking
for (a) and (e). There's no need to check for rule (b) as
the packet doesn't need to be dropped. Rule (c) is not possible in
the driver as LIM_MGMT_P_KEY is always in the pkey table.

Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-10-30 14:51:36 -04:00
..
bnxt_re bnxt_re: Implement the shutdown hook of the L2-RoCE driver interface 2017-10-25 15:25:08 -04:00
cxgb3 Merge branch 'timer_setup' into for-next 2017-10-18 13:12:09 -04:00
cxgb4 RDMA/cxgb4: Declare stag as __be32 2017-10-25 15:25:00 -04:00
hfi1 IB/hfi1: Validate PKEY for incoming GSI MAD packets 2017-10-30 14:51:36 -04:00
hns RDMA/hns: Add modify CQ support for hip08 2017-10-25 13:37:07 -04:00
i40iw i40iw: Move cqp_cmd_head init to CQP initialization 2017-10-18 13:28:46 -04:00
mlx4 Merge branch 'for-next-early' into for-next 2017-10-18 13:07:13 -04:00
mlx5 IB/mlx5: Add support for RSS on the inner packet 2017-10-25 14:19:32 -04:00
mthca IB/mthca: Fix indentation 2017-10-14 20:47:06 -04:00
nes Merge branch 'timer_setup' into for-next 2017-10-18 13:12:09 -04:00
ocrdma Merge branch 'for-next-early' into for-next 2017-10-18 13:07:13 -04:00
qedr Merge branch 'for-next-early' into for-next 2017-10-18 13:07:13 -04:00
qib Merge branch 'timer_setup' into for-next 2017-10-18 13:12:09 -04:00
usnic RDMA/usnic: Instantiate data structures once 2017-10-14 20:47:07 -04:00
vmw_pvrdma RDMA/vmw_pvrdma: Fix reporting correct opcodes for completion 2017-09-22 13:32:22 -04:00
Makefile RDMA/bnxt_re: Add bnxt_re driver build support 2017-02-14 09:51:28 -05:00