From: Linus T. <tor...@li...> - 2009-06-02 18:57:25
|
On Tue, 2 Jun 2009, Alan Cox wrote: > > > ie the fact that the TTY layer does user-mode copies while holding some > > tty lock. So now the tty layer introduces that chain from some random lock > > to the mmap_sem. > > Its basically holding the termios lock to copy from the struct termios to > user space which means its trivial to do copy to a stack buffer first. I > can fix that pretty easily if you want. It would be good. I don't know if it matters for any other path, but mmap_sem has always been a total _bitch_ to work around for deadlocks, so it's always good to try to avoid holding another lock while doing copying to/from user. I thought we already always copied things to a buffer (for conversion reasons, ie doing the whole "ktermios<->random-user-termios-of-the-day" thing), but I guess I was wrong. Linus |