From: Petr Vandrovec <vandrove@vc.cvut.cz>
To: jsimmons@infradead.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Kernel crash triggered by con2fb
Date: Thu, 24 Apr 2003 23:50:33 +0200 [thread overview]
Message-ID: <20030424215033.GA9384@vana.vc.cvut.cz> (raw)
Hi James,
it is not nice that anybody can crash my kernel by
doing con2fb with unallocated VT.
Thanks,
Petr Vandrovec
vandrove@vc.cvut.cz
diff -urN linux-2.5.68-c1216.dist/drivers/video/console/fbcon.c linux-2.5.68-c1216.fb/drivers/video/console/fbcon.c
--- linux-2.5.68-c1216.dist/drivers/video/console/fbcon.c 2003-04-24 19:35:16.000000000 +0200
+++ linux-2.5.68-c1216.fb/drivers/video/console/fbcon.c 2003-04-24 23:37:24.000000000 +0200
@@ -294,13 +294,17 @@
* Maps a virtual console @unit to a frame buffer device
* @newidx.
*/
-void set_con2fb_map(int unit, int newidx)
+int set_con2fb_map(int unit, int newidx)
{
struct vc_data *vc = vc_cons[unit].d;
+ if (!vc) {
+ return -ENODEV;
+ }
con2fb_map[unit] = newidx;
fbcon_is_default = (vc->vc_sw == &fb_con) ? 1 : 0;
take_over_console(&fb_con, unit, unit, fbcon_is_default);
+ return 0;
}
/*
diff -urN linux-2.5.68-c1216.dist/drivers/video/console/fbcon.h linux-2.5.68-c1216.fb/drivers/video/console/fbcon.h
--- linux-2.5.68-c1216.dist/drivers/video/console/fbcon.h 2003-04-24 19:35:21.000000000 +0200
+++ linux-2.5.68-c1216.fb/drivers/video/console/fbcon.h 2003-04-24 23:37:04.000000000 +0200
@@ -38,7 +38,7 @@
/* drivers/video/console/fbcon.c */
extern char con2fb_map[MAX_NR_CONSOLES];
-extern void set_con2fb_map(int unit, int newidx);
+extern int set_con2fb_map(int unit, int newidx);
/*
* Attribute Decoding
diff -urN linux-2.5.68-c1216.dist/drivers/video/fbmem.c linux-2.5.68-c1216.fb/drivers/video/fbmem.c
--- linux-2.5.68-c1216.dist/drivers/video/fbmem.c 2003-04-24 19:33:03.000000000 +0200
+++ linux-2.5.68-c1216.fb/drivers/video/fbmem.c 2003-04-24 23:36:48.000000000 +0200
@@ -1035,7 +1035,7 @@
if (!registered_fb[con2fb.framebuffer])
return -EINVAL;
if (con2fb.console != 0)
- set_con2fb_map(con2fb.console-1, con2fb.framebuffer);
+ return set_con2fb_map(con2fb.console-1, con2fb.framebuffer);
else
fb_console_init();
return 0;
next reply other threads:[~2003-04-24 21:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-24 21:50 Petr Vandrovec [this message]
2003-04-24 23:28 ` [PATCH] Kernel crash triggered by con2fb James Simmons
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030424215033.GA9384@vana.vc.cvut.cz \
--to=vandrove@vc.cvut.cz \
--cc=jsimmons@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).