Re: [PATCH] RDMA/cma: add rdma_destroy_id_wq() and use it from RDS
From: Jason Gunthorpe
Date: Sat Nov 14 2026 - 19:19:09 EST
On Sat, Nov 14, 2026 at 11:05:41PM +0800, Aibing Chen wrote:
> syzbot reported a possible circular locking dependency between
> rds_trans_sem and the RDMA CM handler mutex:
>
> CPU0 (bind path) CPU1 (CM callback path)
> ---- ----
> down_read(&rds_trans_sem) mutex_lock(&handler_mutex)
> rds_ib_laddr_check() cma_ib_req_handler()
> rdma_destroy_id() rds_ib_cm_handle_connect()
> mutex_lock(&handler_mutex) rds_conn_create()
> rds_trans_get_preferred()
> down_read(&rds_trans_sem)
>
> rds_ib_laddr_check_cm() destroys the CM id from inside
> rds_trans_get_preferred()'s read-side critical section, while CM
> callbacks create RDS connections (taking the same read lock) from
> under handler_mutex.
>
> Break the cycle by destroying the CM id asynchronously: add
> rdma_destroy_id_wq(), which queues the destruction on cma_wq, and
> switch rds_ib_laddr_check_cm() to it. The destroy work is embedded
> in struct rdma_id_private, which keeps the id alive until the work
> runs; rds does not touch cm_id after the destroy call.
This doesn't seem like it should be the core codes problem? Why can't
rds do the workqueue?
Jason