diff options
author | Shay Drory <shayd@nvidia.com> | 2021-04-18 16:55:54 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-04-22 02:53:14 +0300 |
commit | cb5cd0ea4eb3ce338a593a5331ddb4986ae20faa (patch) | |
tree | 7762916197bcba1b17902188b48e9ed6eb899178 /lib/test_lockup.c | |
parent | 4d51c3d9de4bf5b9d637966dce9d1df77ed93288 (diff) | |
download | linux-cb5cd0ea4eb3ce338a593a5331ddb4986ae20faa.tar.xz |
RDMA/core: Add CM to restrack after successful attachment to a device
The device attach triggers addition of CM_ID to the restrack DB.
However, when error occurs, we releasing this device, but defer CM_ID
release. This causes to the situation where restrack sees CM_ID that
is not valid anymore.
As a solution, add the CM_ID to the resource tracking DB only after the
attachment is finished.
Found by syzcaller:
infiniband syz0: added syz_tun
rdma_rxe: ignoring netdev event = 10 for syz_tun
infiniband syz0: set down
infiniband syz0: ib_query_port failed (-19)
restrack: ------------[ cut here ]------------
infiniband syz0: BUG: RESTRACK detected leak of resources
restrack: User CM_ID object allocated by syz-executor716 is not freed
restrack: ------------[ cut here ]------------
Fixes: b09c4d701220 ("RDMA/restrack: Improve readability in task name management")
Link: https://lore.kernel.org/r/ab93e56ba831eac65c322b3256796fa1589ec0bb.1618753862.git.leonro@nvidia.com
Signed-off-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'lib/test_lockup.c')
0 files changed, 0 insertions, 0 deletions