Commit 13fa887
committed
RDMA/iwcm: Fix a use-after-free related to destroying CM IDs
jira LE-4066
cve CVE-2024-42285
Rebuild_History Non-Buildable kernel-4.18.0-553.72.1.el8_10
commit-author Bart Van Assche <bvanassche@acm.org>
commit aee2424
iw_conn_req_handler() associates a new struct rdma_id_private (conn_id) with
an existing struct iw_cm_id (cm_id) as follows:
conn_id->cm_id.iw = cm_id;
cm_id->context = conn_id;
cm_id->cm_handler = cma_iw_handler;
rdma_destroy_id() frees both the cm_id and the struct rdma_id_private. Make
sure that cm_work_handler() does not trigger a use-after-free by only
freeing of the struct rdma_id_private after all pending work has finished.
Cc: stable@vger.kernel.org
Fixes: 59c68ac ("iw_cm: free cm_id resources on the last deref")
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240605145117.397751-6-bvanassche@acm.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
(cherry picked from commit aee2424)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>1 parent 50034aa commit 13fa887
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
| 372 | + | |
| 373 | + | |
372 | 374 | | |
373 | | - | |
| 375 | + | |
374 | 376 | | |
375 | 377 | | |
376 | 378 | | |
| |||
440 | 442 | | |
441 | 443 | | |
442 | 444 | | |
443 | | - | |
| 445 | + | |
444 | 446 | | |
445 | 447 | | |
446 | 448 | | |
| |||
451 | 453 | | |
452 | 454 | | |
453 | 455 | | |
454 | | - | |
| 456 | + | |
| 457 | + | |
455 | 458 | | |
456 | 459 | | |
457 | 460 | | |
| |||
1035 | 1038 | | |
1036 | 1039 | | |
1037 | 1040 | | |
1038 | | - | |
| 1041 | + | |
1039 | 1042 | | |
1040 | 1043 | | |
1041 | 1044 | | |
| |||
0 commit comments