Repository navigation
Commit cb5cd0e
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: 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>1 parent 4d51c3d commit cb5cd0e
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
458 | 457 | | |
459 | 458 | | |
460 | 459 | | |
| |||
691 | 690 | | |
692 | 691 | | |
693 | 692 | | |
| 693 | + | |
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
| |||
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
748 | | - | |
| 748 | + | |
749 | 749 | | |
| 750 | + | |
| 751 | + | |
750 | 752 | | |
751 | 753 | | |
752 | 754 | | |
| |||
807 | 809 | | |
808 | 810 | | |
809 | 811 | | |
| 812 | + | |
810 | 813 | | |
811 | 814 | | |
812 | 815 | | |
| |||
2526 | 2529 | | |
2527 | 2530 | | |
2528 | 2531 | | |
| 2532 | + | |
2529 | 2533 | | |
2530 | 2534 | | |
2531 | 2535 | | |
| |||
3203 | 3207 | | |
3204 | 3208 | | |
3205 | 3209 | | |
| 3210 | + | |
3206 | 3211 | | |
3207 | 3212 | | |
3208 | 3213 | | |
| |||
3235 | 3240 | | |
3236 | 3241 | | |
3237 | 3242 | | |
| 3243 | + | |
3238 | 3244 | | |
3239 | 3245 | | |
3240 | 3246 | | |
| |||
3846 | 3852 | | |
3847 | 3853 | | |
3848 | 3854 | | |
| 3855 | + | |
| 3856 | + | |
3849 | 3857 | | |
3850 | 3858 | | |
3851 | 3859 | | |
| |||
0 commit comments