OSDN Git Service

IB/core: Only maintain real QPs in the security lists
authorDaniel Jurgens <danielj@mellanox.com>
Tue, 7 Nov 2017 16:33:26 +0000 (18:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Nov 2017 08:40:55 +0000 (08:40 +0000)
commitf92dea588014ae5083cac7ee33c88d58c9e87127
tree5e94f719bab69342fd1dcdcc407c27af8d477fc0
parent2477321f8a1ae2920ba503e4216992bddfb33687
IB/core: Only maintain real QPs in the security lists

commit 877add28178a7fa3c68f29c450d050a8e6513f08 upstream.

When modify QP is called on a shared QP update the security context for
the real QP. When security is subsequently enforced the shared QP
handles will be checked as well.

Without this change shared QP handles get added to the port/pkey lists,
which is a bug, because not all shared QP handles will be checked for
access. Also the shared QP security context wouldn't get removed from
the port/pkey lists causing access to free memory and list corruption
when they are destroyed.

Fixes: d291f1a65232 ("IB/core: Enforce PKey security on QPs")
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/security.c