The patch titled
hvc_console: Add some sanity checks
has been added to the -mm tree. Its filename is
hvc_console-add-some-sanity-checks.patch
Patches currently in -mm which might be from [EMAIL PROTECTED] are
hvc_console-rearrange-code.patch
hvc_console-match-vio-and-console-devices-using-vterm-numbers.patch
hvc_console-dont-always-kick-the-poll-thread-in-interrupt.patch
hvc_console-magic_sysrq-should-only-be-on-console-channel.patch
hvc_console-unregister-the-console-in-the-exit-routine.patch
hvc_console-add-missing-include.patch
hvc_console-remove-num_vterms-and-some-dead-code.patch
hvc_console-statically-initialize-the-vtermnos-array.patch
hvc_console-add-some-sanity-checks.patch
hvc_console-separate-hvc_console-and-vio-code.patch
hvc_console-separate-hvc_console-and-vio-code-2.patch
hvc_console-register-ops-when-setting-up-hvc_console.patch
hvc_console-separate-the-nul-character-filtering-from-get_hvc_chars.patch
hvc_console-use-hvc_get_chars-in-hvsi-code.patch
From: Milton Miller <[EMAIL PROTECTED]>
Check if a vterm was registered before accepting it as a console.
Check that a slot hasn't been probed with a tty in hvc_instantiate().
Check that a slot hasn't been free'ed when handing out console device.
Signed-off-by: Milton Miller <[EMAIL PROTECTED]>
Signed-off-by: Anton Blanchard <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
drivers/char/hvc_console.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+)
diff -puN drivers/char/hvc_console.c~hvc_console-add-some-sanity-checks
drivers/char/hvc_console.c
--- 25/drivers/char/hvc_console.c~hvc_console-add-some-sanity-checks Wed Jul
6 14:00:35 2005
+++ 25-akpm/drivers/char/hvc_console.c Wed Jul 6 14:00:35 2005
@@ -192,12 +192,21 @@ void hvc_console_print(struct console *c
static struct tty_driver *hvc_console_device(struct console *c, int *index)
{
+ if (vtermnos[c->index] == -1)
+ return NULL;
+
*index = c->index;
return hvc_driver;
}
static int __init hvc_console_setup(struct console *co, char *options)
{
+ if (co->index < 0 || co->index >= MAX_NR_HVC_CONSOLES)
+ return -ENODEV;
+
+ if (vtermnos[co->index] == -1)
+ return -ENODEV;
+
return 0;
}
@@ -227,12 +236,21 @@ console_initcall(hvc_console_init);
*/
int hvc_instantiate(uint32_t vtermno, int index)
{
+ struct hvc_struct *hp;
+
if (index < 0 || index >= MAX_NR_HVC_CONSOLES)
return -1;
if (vtermnos[index] != -1)
return -1;
+ /* make sure no no tty has been registerd in this index */
+ hp = hvc_get_by_index(index);
+ if (hp) {
+ kobject_put(&hp->kobj);
+ return -1;
+ }
+
vtermnos[index] = vtermno;
/* reserve all indices upto and including this index */
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html