Re: [PATCH] tty: Prevent deadlock in n_gsm driver

From: Ben Hutchings
Date: Sat Mar 02 2013 - 14:08:09 EST


I'm looking at commit 4d9b109060f690f5c835130ff54165ae157b3087 ('tty:
Prevent deadlock in n_gsm driver') which was cc'd to stable. This drops
the tty lock in gsm_dlci_release().

I could apply it to 3.2.y with some adjustment, but I checked the
locking context of this function and I think there's another bug to fix.
Tracing back the callers in 3.2.y I found:

gsm_dlci_release
<- gsm_cleanup_mux
<- gsmld_detach_gsm
<- gsmld_close
<- tty_ldisc_close
<- tty_set_ldisc [with tty_lock]
<- tty_ldisc_reinit
<- tty_ldisc_hangup [with tty_lock]
<- gsmld_config
<- gsmld_ioctl
<- tty_ioctl [without tty lock]

and I think the call chains are much the same in mainline. So
gsmld_config() presumably needs to acquire the tty lock.

Ben.

--
Ben Hutchings
Computers are not intelligent. They only think they are.

Attachment: signature.asc
Description: This is a digitally signed message part