Re: [PATCH] Bluetooth: RFCOMM: serialize security confirmation handling

From: Luiz Augusto von Dentz

Date: Tue Aug 25 2026 - 15:22:23 EST


Hi Chengfeng,

On Tue, Aug 25, 2026 at 2:46 PM Chengfeng Ye <nicoyip.dev@xxxxxxxxx> wrote:
>
> Hi Luiz,
>
> On Tue, Aug 25, 2026 at 4:24 AM Luiz Augusto von Dentz
> <luiz.dentz@xxxxxxxxx> wrote:
> > Interesting, I though the kernel_connect would actually behave as a
> > syscall and use it own thread so it wouldn't result into
> > l2cap_chan_connect, in that case it is probably useless to use it in
> > place of l2cap_chan_connect directly, so we may take the opportunity
> > and clean this up.
>
> Sorry for the negligence of the possible deadlock cycle. Could we
> avoid the locking cycle by directly moving the session lookup and DLC
> walk onto krfcommd so rfcomm_security_cfm() no longer takes
> rfcomm_mutex from hci_rx_work? If we need a fix like this, should I
> send a follow-up patch or send a v2?

It is a possible solution, that said couldn't we do the walk using
rcu_read_lock/list_for_each_entry_rcu/rcu_read_unlock?

> Best regards,
> Chengfeng



--
Luiz Augusto von Dentz