Loading drivers/tty/vt/vt_ioctl.c +9 −22 Original line number Original line Diff line number Diff line Loading @@ -1171,17 +1171,13 @@ long vt_compat_ioctl(struct tty_struct *tty, { { struct vc_data *vc = tty->driver_data; struct vc_data *vc = tty->driver_data; struct console_font_op op; /* used in multiple places here */ struct console_font_op op; /* used in multiple places here */ unsigned int console; unsigned int console = vc->vc_num; void __user *up = (void __user *)arg; void __user *up = compat_ptr(arg); int perm; int perm; int ret = 0; console = vc->vc_num; if (!vc_cons_allocated(console)) { /* impossible? */ if (!vc_cons_allocated(console)) /* impossible? */ ret = -ENOIOCTLCMD; return -ENOIOCTLCMD; goto out; } /* /* * To have permissions to do most of the vt ioctls, we either have * To have permissions to do most of the vt ioctls, we either have Loading @@ -1197,17 +1193,14 @@ long vt_compat_ioctl(struct tty_struct *tty, */ */ case PIO_FONTX: case PIO_FONTX: case GIO_FONTX: case GIO_FONTX: ret = compat_fontx_ioctl(cmd, up, perm, &op); return compat_fontx_ioctl(cmd, up, perm, &op); break; case KDFONTOP: case KDFONTOP: ret = compat_kdfontop_ioctl(up, perm, &op, vc); return compat_kdfontop_ioctl(up, perm, &op, vc); break; case PIO_UNIMAP: case PIO_UNIMAP: case GIO_UNIMAP: case GIO_UNIMAP: ret = compat_unimap_ioctl(cmd, up, perm, vc); return compat_unimap_ioctl(cmd, up, perm, vc); break; /* /* * all these treat 'arg' as an integer * all these treat 'arg' as an integer Loading @@ -1232,21 +1225,15 @@ long vt_compat_ioctl(struct tty_struct *tty, case VT_DISALLOCATE: case VT_DISALLOCATE: case VT_RESIZE: case VT_RESIZE: case VT_RESIZEX: case VT_RESIZEX: goto fallback; return vt_ioctl(tty, cmd, arg); /* /* * the rest has a compatible data structure behind arg, * the rest has a compatible data structure behind arg, * but we have to convert it to a proper 64 bit pointer. * but we have to convert it to a proper 64 bit pointer. */ */ default: default: arg = (unsigned long)compat_ptr(arg); return vt_ioctl(tty, cmd, (unsigned long)up); goto fallback; } } out: return ret; fallback: return vt_ioctl(tty, cmd, arg); } } Loading Loading
drivers/tty/vt/vt_ioctl.c +9 −22 Original line number Original line Diff line number Diff line Loading @@ -1171,17 +1171,13 @@ long vt_compat_ioctl(struct tty_struct *tty, { { struct vc_data *vc = tty->driver_data; struct vc_data *vc = tty->driver_data; struct console_font_op op; /* used in multiple places here */ struct console_font_op op; /* used in multiple places here */ unsigned int console; unsigned int console = vc->vc_num; void __user *up = (void __user *)arg; void __user *up = compat_ptr(arg); int perm; int perm; int ret = 0; console = vc->vc_num; if (!vc_cons_allocated(console)) { /* impossible? */ if (!vc_cons_allocated(console)) /* impossible? */ ret = -ENOIOCTLCMD; return -ENOIOCTLCMD; goto out; } /* /* * To have permissions to do most of the vt ioctls, we either have * To have permissions to do most of the vt ioctls, we either have Loading @@ -1197,17 +1193,14 @@ long vt_compat_ioctl(struct tty_struct *tty, */ */ case PIO_FONTX: case PIO_FONTX: case GIO_FONTX: case GIO_FONTX: ret = compat_fontx_ioctl(cmd, up, perm, &op); return compat_fontx_ioctl(cmd, up, perm, &op); break; case KDFONTOP: case KDFONTOP: ret = compat_kdfontop_ioctl(up, perm, &op, vc); return compat_kdfontop_ioctl(up, perm, &op, vc); break; case PIO_UNIMAP: case PIO_UNIMAP: case GIO_UNIMAP: case GIO_UNIMAP: ret = compat_unimap_ioctl(cmd, up, perm, vc); return compat_unimap_ioctl(cmd, up, perm, vc); break; /* /* * all these treat 'arg' as an integer * all these treat 'arg' as an integer Loading @@ -1232,21 +1225,15 @@ long vt_compat_ioctl(struct tty_struct *tty, case VT_DISALLOCATE: case VT_DISALLOCATE: case VT_RESIZE: case VT_RESIZE: case VT_RESIZEX: case VT_RESIZEX: goto fallback; return vt_ioctl(tty, cmd, arg); /* /* * the rest has a compatible data structure behind arg, * the rest has a compatible data structure behind arg, * but we have to convert it to a proper 64 bit pointer. * but we have to convert it to a proper 64 bit pointer. */ */ default: default: arg = (unsigned long)compat_ptr(arg); return vt_ioctl(tty, cmd, (unsigned long)up); goto fallback; } } out: return ret; fallback: return vt_ioctl(tty, cmd, arg); } } Loading