Re: possible deadlock in rds_wake_sk_sleep

From: Sowmini Varadhan
Date: Tue Aug 07 2018 - 17:08:05 EST


On (08/07/18 13:47), syzbot wrote:
> Possible unsafe locking scenario:
>
> CPU0 CPU1
> ---- ----
> lock(&(&rm->m_rs_lock)->rlock);
> lock(&rs->rs_recv_lock);
> lock(&(&rm->m_rs_lock)->rlock);
> lock(&rs->rs_recv_lock);
>
> *** DEADLOCK ***

looks like a valid find, I think the deadlock should be avoided
by having rds_clear_recv_queue do something like

get rs_recv_lock
un-tether the rs_recv_queue into a temporary list
releease rs_recv_lock
purge the rds_incoming temporary list

I can give this a shot later this week.

--Sowmini