]> git.itanic.dy.fi Git - linux-stable/commit
IB/core: Fix potential memory leak while creating MAD agents
authorDaniel Jurgens <danielj@mellanox.com>
Sat, 2 Feb 2019 09:09:43 +0000 (11:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2019 05:21:53 +0000 (07:21 +0200)
commit841487432d11e299001e7640072347c64ea47a23
treeeba75874998002db591b66504c786807c4c50b98
parentdabcbe58d8bc289c544f0bc7750079a6ca09db14
IB/core: Fix potential memory leak while creating MAD agents

commit 6e88e672b69f0e627acdae74a527b730ea224b6b upstream.

If the MAD agents isn't allowed to manage the subnet, or fails to register
for the LSM notifier, the security context is leaked. Free the context in
these cases.

Fixes: 47a2b338fe63 ("IB/core: Enforce security on management datagrams")
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Reported-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/security.c