Commit f8b0c2e6 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

tty: vt, ignore PIO_UNIMAPCLR param

We do not do hashtables for unicode fonts since 1995 (1.3.28). So it
is time to remove the second parameter of con_clear_unimap and ignore
the advice from userspace completely.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6ca8dfd7
...@@ -499,9 +499,8 @@ con_insert_unipair(struct uni_pagedir *p, u_short unicode, u_short fontpos) ...@@ -499,9 +499,8 @@ con_insert_unipair(struct uni_pagedir *p, u_short unicode, u_short fontpos)
return 0; return 0;
} }
/* ui is a leftover from using a hashtable, but might be used again /* Caller must hold the lock */
Caller must hold the lock */ static int con_do_clear_unimap(struct vc_data *vc)
static int con_do_clear_unimap(struct vc_data *vc, struct unimapinit *ui)
{ {
struct uni_pagedir *p, *q; struct uni_pagedir *p, *q;
...@@ -524,11 +523,11 @@ static int con_do_clear_unimap(struct vc_data *vc, struct unimapinit *ui) ...@@ -524,11 +523,11 @@ static int con_do_clear_unimap(struct vc_data *vc, struct unimapinit *ui)
return 0; return 0;
} }
int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui) int con_clear_unimap(struct vc_data *vc)
{ {
int ret; int ret;
console_lock(); console_lock();
ret = con_do_clear_unimap(vc, ui); ret = con_do_clear_unimap(vc);
console_unlock(); console_unlock();
return ret; return ret;
} }
...@@ -556,7 +555,7 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list) ...@@ -556,7 +555,7 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
int j, k; int j, k;
u16 **p1, *p2, l; u16 **p1, *p2, l;
err1 = con_do_clear_unimap(vc, NULL); err1 = con_do_clear_unimap(vc);
if (err1) { if (err1) {
console_unlock(); console_unlock();
return err1; return err1;
...@@ -677,7 +676,7 @@ int con_set_default_unimap(struct vc_data *vc) ...@@ -677,7 +676,7 @@ int con_set_default_unimap(struct vc_data *vc)
/* The default font is always 256 characters */ /* The default font is always 256 characters */
err = con_do_clear_unimap(vc, NULL); err = con_do_clear_unimap(vc);
if (err) if (err)
return err; return err;
......
...@@ -1006,16 +1006,10 @@ int vt_ioctl(struct tty_struct *tty, ...@@ -1006,16 +1006,10 @@ int vt_ioctl(struct tty_struct *tty,
break; break;
case PIO_UNIMAPCLR: case PIO_UNIMAPCLR:
{ struct unimapinit ui;
if (!perm) if (!perm)
return -EPERM; return -EPERM;
ret = copy_from_user(&ui, up, sizeof(struct unimapinit)); con_clear_unimap(vc);
if (ret)
ret = -EFAULT;
else
con_clear_unimap(vc, &ui);
break; break;
}
case PIO_UNIMAP: case PIO_UNIMAP:
case GIO_UNIMAP: case GIO_UNIMAP:
......
...@@ -59,14 +59,13 @@ int tioclinux(struct tty_struct *tty, unsigned long arg); ...@@ -59,14 +59,13 @@ int tioclinux(struct tty_struct *tty, unsigned long arg);
#ifdef CONFIG_CONSOLE_TRANSLATIONS #ifdef CONFIG_CONSOLE_TRANSLATIONS
/* consolemap.c */ /* consolemap.c */
struct unimapinit;
struct unipair; struct unipair;
int con_set_trans_old(unsigned char __user * table); int con_set_trans_old(unsigned char __user * table);
int con_get_trans_old(unsigned char __user * table); int con_get_trans_old(unsigned char __user * table);
int con_set_trans_new(unsigned short __user * table); int con_set_trans_new(unsigned short __user * table);
int con_get_trans_new(unsigned short __user * table); int con_get_trans_new(unsigned short __user * table);
int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui); int con_clear_unimap(struct vc_data *vc);
int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list); int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list);
int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct, struct unipair __user *list); int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct, struct unipair __user *list);
int con_set_default_unimap(struct vc_data *vc); int con_set_default_unimap(struct vc_data *vc);
...@@ -92,7 +91,7 @@ static inline int con_get_trans_new(unsigned short __user *table) ...@@ -92,7 +91,7 @@ static inline int con_get_trans_new(unsigned short __user *table)
{ {
return -EINVAL; return -EINVAL;
} }
static inline int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui) static inline int con_clear_unimap(struct vc_data *vc)
{ {
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment