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: <1253046897-9981-1-git-send-email-currojerez@riseup.net>
Date:	Tue, 15 Sep 2009 22:34:57 +0200
From:	Francisco Jerez <currojerez@...eup.net>
To:	linux-kernel@...r.kernel.org
Cc:	"Antonino A. Daplas" <adaplas@...il.com>,
	Andrew Morton <akpm@...l.org>, Dave Airlie <airlied@...il.com>,
	nouveau@...ts.freedesktop.org
Subject: [PATCH] vgacon: Prevent vgacon_deinit from touching the hardware for inactive consoles.

fbcon makes the (reasonable) assumption that it only needs to program
the hardware once, when fbcon_init() is called for the foreground
console. This doesn't always play well with vgacon because
vgacon_deinit() is only doing its job when the last console it owns is
closed (in most cases, that is *after* fbcon_init() has set the new
mode). Depending on the hardware this can cause the wrong framebuffer
location to be scanned out (e.g. reproduced on nv05 with the nouveau
framebuffer driver).

Signed-off-by: Francisco Jerez <currojerez@...eup.net>
---
This makes me wonder if it's actually useful to restore the scanout
address on vgacon_deinit(). If it wasn't anymore, I guess the right
thing to do would be to just remove the offending lines...

 drivers/video/console/vgacon.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 59d7d5e..6bd75a9 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -590,12 +590,14 @@ static void vgacon_init(struct vc_data *c, int init)
 
 static void vgacon_deinit(struct vc_data *c)
 {
-	/* When closing the last console, reset video origin */
-	if (!--vgacon_uni_pagedir[1]) {
+	/* When closing the active console, reset video origin */
+	if (CON_IS_VISIBLE(c)) {
 		c->vc_visible_origin = vga_vram_base;
 		vga_set_mem_top(c);
-		con_free_unimap(c);
 	}
+
+	if (!--vgacon_uni_pagedir[1])
+		con_free_unimap(c);
 	c->vc_uni_pagedir_loc = &c->vc_uni_pagedir;
 	con_set_default_unimap(c);
 }
-- 
1.6.3.3

--
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