Re: [PATCH 3/3] tty_lock: Localise the lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alan,

On Thu, May 3, 2012 at 11:24 PM, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
> diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
> index 5505ffc..d6fa842 100644
> --- a/drivers/tty/pty.c
> +++ b/drivers/tty/pty.c
> @@ -62,9 +63,7 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
>                        mutex_unlock(&devpts_mutex);
>                }
>  #endif
> -               tty_unlock();
>                tty_vhangup(tty->link);
> -               tty_lock();
>        }
>  }

I don't believe that this change is correct.

Consider the following scenario:

tty_release -> tty_lock -> pty_close -> tty_vhangup -> tty_lock

Which would cause a deadlock.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux