Re: [PATCH] tty: ldisc: fix deadlock between ldisc_sem and rtnl_mutex

"Zhou, Yun" <[email protected]> Fri, 17 Jul 2026 11:42:28 +0800
Newsgroups org.kernel.vger.linux-can,org.kernel.vger.linux-kernel,org.kernel.vger.linux-serial,org.kernel.vger.netdev
Message-ID <[email protected]>
Hi Jagielski,

On 7/16/26 15:59, Jagielski, Jedrzej wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> From: Yun Zhou <[email protected]>
> Sent: Thursday, July 16, 2026 8:47 AM
> 
>> syzbot reported a circular lock dependency involving tty ldisc_sem and
>> the networking rtnl_mutex. The full chain is:
>>
>>   rtnl_mutex --> nft_commit_mutex --> ... --> ep->mtx --> ldisc_sem --> rtnl_mutex
> 
> still unclear where the first mutex may come from

   tty_set_ldisc()
     tty_ldisc_lock()        <- hold ldisc_sem
       tty_ldisc_open()
         slcan_open()
           register_candev()
             register_netdev()
               rtnl_net_lock_killable()  <- hold rtnl_mutex

> 
>>
>> +      tty_ldisc_unlock(tty);
>>
>> +      /*
> 
> this blank line is redundant i believe
> 

Isn't it common practice to leave the first line of a multi-line comment 
blank? Does it violate the coding style guidelines?

BR,
Yun