Repository navigation
Commit c5ebaca
RDMA/core: Add CM to restrack after successful attachment to a device
[ Upstream commit cb5cd0e ]
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: b09c4d7 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 63c61d2 commit c5ebaca
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
467 | 466 | | |
468 | 467 | | |
469 | 468 | | |
| |||
700 | 699 | | |
701 | 700 | | |
702 | 701 | | |
| 702 | + | |
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | | - | |
| 757 | + | |
758 | 758 | | |
| 759 | + | |
| 760 | + | |
759 | 761 | | |
760 | 762 | | |
761 | 763 | | |
| |||
816 | 818 | | |
817 | 819 | | |
818 | 820 | | |
| 821 | + | |
819 | 822 | | |
820 | 823 | | |
821 | 824 | | |
| |||
2529 | 2532 | | |
2530 | 2533 | | |
2531 | 2534 | | |
| 2535 | + | |
2532 | 2536 | | |
2533 | 2537 | | |
2534 | 2538 | | |
| |||
3169 | 3173 | | |
3170 | 3174 | | |
3171 | 3175 | | |
| 3176 | + | |
3172 | 3177 | | |
3173 | 3178 | | |
3174 | 3179 | | |
| |||
3201 | 3206 | | |
3202 | 3207 | | |
3203 | 3208 | | |
| 3209 | + | |
3204 | 3210 | | |
3205 | 3211 | | |
3206 | 3212 | | |
| |||
3812 | 3818 | | |
3813 | 3819 | | |
3814 | 3820 | | |
| 3821 | + | |
| 3822 | + | |
3815 | 3823 | | |
3816 | 3824 | | |
3817 | 3825 | | |
| |||
0 commit comments