[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1405208640-3613-1-git-send-email-linux@rasmusvillemoes.dk>
Date: Sun, 13 Jul 2014 01:44:00 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.cz>,
Dan Carpenter <dan.carpenter@...cle.com>, julia.lawall@...6.fr
Cc: linux-kernel@...r.kernel.org,
Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: [PATCH] drivers: tty: Fix use-after-free in pty_common_install
In 2c964a2f "drivers: tty: Merge alloc_tty_struct and
initialize_tty_struct", I messed up the refactorization of
pty_common_install, causing use-after-free and NULL pointer derefs on
various error paths. This should fix it.
Reported-by: Julia Lawall <julia.lawall@...6.fr>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
---
drivers/tty/pty.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index ac723e3..9bbdb1d 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -388,7 +388,7 @@ err_deinit_tty:
deinitialize_tty_struct(o_tty);
free_tty_struct(o_tty);
err_put_module:
- module_put(o_tty->driver->owner);
+ module_put(driver->other->owner);
err:
kfree(ports[0]);
kfree(ports[1]);
--
1.9.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists