IB/core: Only enforce security for InfiniBand
authorDaniel Jurgens <danielj@mellanox.com>
Wed, 29 Nov 2017 18:10:39 +0000 (20:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:53:03 +0000 (09:53 +0100)
commit796c9d1e275e3e35ae13b16021498bc12ab2593e
treede043a076422a2e07f95836978b9ad7b3c83cf6f
parent45f846ca6b2119237adfa19a9bbfce43dadb558e
IB/core: Only enforce security for InfiniBand

commit 315d160c5a4e034a576a13aa21e7235d5c9ec609 upstream.

For now the only LSM security enforcement mechanism available is
specific to InfiniBand. Bypass enforcement for non-IB link types.

This fixes a regression where modify_qp fails for iWARP because
querying the PKEY returns -EINVAL.

Cc: Paul Moore <paul@paul-moore.com>
Cc: Don Dutile <ddutile@redhat.com>
Reported-by: Potnuri Bharat Teja <bharat@chelsio.com>
Fixes: d291f1a65232("IB/core: Enforce PKey security on QPs")
Fixes: 47a2b338fe63("IB/core: Enforce security on management datagrams")
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Tested-by: Potnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/security.c