aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-01-27 06:50:37 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-27 10:37:15 -0500
commit808ffa3d302257b9dc37b1412c1fcdf976fcddac (patch)
tree9d6d6de93da50d6c2df3cc7b0052a189f410a076 /drivers/char
parent5ee810072175042775e39bdd3eaaa68884c27805 (diff)
tty_open can return to userspace holding tty_mutex
__tty_open could return (to userspace) holding the tty_mutex thanks to a regression introduced by 4a2b5fddd53b80efcb3266ee36e23b8de28e761a ("Move tty lookup/reopen to caller"). This was found by bisecting an fsfuzzer problem. Admittedly I have no idea how it managed to tickle this 100% reliably, but it is clearly a regression and when hit leaves the box in a completely unusable state. This patch lets the fsfuzzer test complete every time. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tty_io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index d33e5ab06177..bc84e125c6bc 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1817,8 +1817,10 @@ got_driver:
1817 /* check whether we're reopening an existing tty */ 1817 /* check whether we're reopening an existing tty */
1818 tty = tty_driver_lookup_tty(driver, inode, index); 1818 tty = tty_driver_lookup_tty(driver, inode, index);
1819 1819
1820 if (IS_ERR(tty)) 1820 if (IS_ERR(tty)) {
1821 mutex_unlock(&tty_mutex);
1821 return PTR_ERR(tty); 1822 return PTR_ERR(tty);
1823 }
1822 } 1824 }
1823 1825
1824 if (tty) { 1826 if (tty) {