lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131230032118.GB4424@udknight>
Date:	Mon, 30 Dec 2013 11:21:18 +0800
From:	Wang YanQing <udknight@...il.com>
To:	gregkh@...uxfoundation.org
Cc:	jslaby@...e.cz, airlied@...hat.com, akpm@...ux-foundation.org,
	kilobyte@...band.pl, linux-kernel@...r.kernel.org
Subject: [PATCH v2]vt: fix potential dual con_driver register for conswitchp

We should check whether conswitchp is registered before
add it to registered_con_driver in con_init, or it will
cause dual con_driver register for conswitchp.

Although I haven't met it in reality, but I think it could
happen for Embeded devices, who register platform con_driver
earlier than call con_init.

Signed-off-by: Wang YanQing <udknight@...il.com>
---
 Change v1-v2:
 1: if conswitchp is registered, then 
    make it become "system driver" by
    change value of first,last,flag.

 drivers/tty/vt/vt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 9adb4e0..b786129 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -2876,6 +2876,12 @@ static int __init con_init(void)
 	for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
 		struct con_driver *con_driver = &registered_con_driver[i];
 
+		if (con_driver->con == conswitchp) {
+			con_driver->flag = CON_DRIVER_FLAG_INIT;
+			con_driver->first = 0;
+			con_driver->last = MAX_NR_CONSOLES - 1;
+			break;
+		}
 		if (con_driver->con == NULL) {
 			con_driver->con = conswitchp;
 			con_driver->desc = display_desc;
-- 
1.8.3.4.8.g69490f3.dirty
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ