]> git.baikalelectronics.ru Git - kernel.git/commit
IB/core: Fix qp_sec use after free access
authorParav Pandit <parav@mellanox.com>
Sun, 24 Sep 2017 18:46:30 +0000 (21:46 +0300)
committerDoug Ledford <dledford@redhat.com>
Mon, 25 Sep 2017 15:47:23 +0000 (11:47 -0400)
commit9eeab917046010ed28f714938b11f5610f8774ff
treed47f424393f797a944696af1cd06108a319ba46f
parentd1856f7bbb8e514d13fa36d22109b574ab3fdba9
IB/core: Fix qp_sec use after free access

When security_ib_alloc_security fails, qp->qp_sec memory is freed.
However ib_destroy_qp still tries to access this memory which result
in kernel crash. So its initialized to NULL to avoid such access.

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