Re: [PATCH net] net/smc: avoid recursive sk_callback_lock in listen data_ready

From: Runyu Xiao

Date: Thu Jul 02 2026 - 04:36:09 EST


Hi Sidraya,

On Thu, Jun 25, 2026 at 02:02:25PM +0530, Sidraya Jayagond wrote:
> In smc_close_active(), the TCP socket remains in TCP_LISTEN state while
> holding write_lock_bh(&smc->clcsock->sk->sk_callback_lock);. The patch's
> state check would pass during this window, not preventing the recursive
> lock scenario.
> It's unclear whether it fully prevents the recursive locking scenario
> described in the commit message for the specific code path in
> smc_close_active().
> Could you come up with exact deadlock scenario and how the patch
> addresses it?

You are right. I do not have a confirmed current mainline call chain where
the callback is invoked under sk_callback_lock, and the TCP_LISTEN check
does not cover the smc_close_active() window you pointed out.

I will drop this patch for now. Thanks for reviewing it.

Runyu