mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] vt: NULL dereference in vt_do_kdsk_ioctl()
@ 2012-03-10  8:59 Dan Carpenter
  2012-03-10 12:45 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-03-10  8:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Alan Cox
  Cc: Jovi Zhang, Thomas Gleixner, Geert Uytterhoeven, linux-kernel,
	kernel-janitors

We forgot to set the "key_map" variable here, so it's still NULL.  This
was introduced recently in 079c9534a9 "vt:tackle kbd_table".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index 70d0593..86dd1e3 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -1863,6 +1863,7 @@ int vt_do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm,
 				return -EPERM;
 			}
 			key_maps[s] = new_map;
+			key_map = new_map;
 			key_map[0] = U(K_ALLOCATED);
 			for (j = 1; j < NR_KEYS; j++)
 				key_map[j] = U(K_HOLE);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] vt: NULL dereference in vt_do_kdsk_ioctl()
  2012-03-10  8:59 [patch] vt: NULL dereference in vt_do_kdsk_ioctl() Dan Carpenter
@ 2012-03-10 12:45 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2012-03-10 12:45 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, Alan Cox, Jovi Zhang, Thomas Gleixner,
	Geert Uytterhoeven, linux-kernel, kernel-janitors

On Sat, 10 Mar 2012 11:59:23 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> We forgot to set the "key_map" variable here, so it's still NULL.  This
> was introduced recently in 079c9534a9 "vt:tackle kbd_table".
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index 70d0593..86dd1e3 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c
> @@ -1863,6 +1863,7 @@ int vt_do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm,
>  				return -EPERM;
>  			}
>  			key_maps[s] = new_map;
> +			key_map = new_map;
>  			key_map[0] = U(K_ALLOCATED);
>  			for (j = 1; j < NR_KEYS; j++)
>  				key_map[j] = U(K_HOLE);

Eep I thought I got all of those. Well noted

Acked-by: Alan Cox <alan@linux.intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-10 12:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-10  8:59 [patch] vt: NULL dereference in vt_do_kdsk_ioctl() Dan Carpenter
2012-03-10 12:45 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®