Skip to content

Commit 050b074

Browse files
kilobytegregkh
authored andcommitted
vt: fix unchecked __put_user() in tioclinux ioctls
commit 6987dc8a70976561d22450b5858fc9767788cc1c upstream. Only read access is checked before this call. Actually, at the moment this is not an issue, as every in-tree arch does the same manual checks for VERIFY_READ vs VERIFY_WRITE, relying on the MMU to tell them apart, but this wasn't the case in the past and may happen again on some odd arch in the future. If anyone cares about 3.7 and earlier, this is a security hole (untested) on real 80386 CPUs. Signed-off-by: Adam Borowski <kilobyte@angband.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 86949eb commit 050b074

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/tty/vt/vt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,13 +2708,13 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
27082708
* related to the kernel should not use this.
27092709
*/
27102710
data = vt_get_shift_state();
2711-
ret = __put_user(data, p);
2711+
ret = put_user(data, p);
27122712
break;
27132713
case TIOCL_GETMOUSEREPORTING:
27142714
console_lock(); /* May be overkill */
27152715
data = mouse_reporting();
27162716
console_unlock();
2717-
ret = __put_user(data, p);
2717+
ret = put_user(data, p);
27182718
break;
27192719
case TIOCL_SETVESABLANK:
27202720
console_lock();
@@ -2723,7 +2723,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
27232723
break;
27242724
case TIOCL_GETKMSGREDIRECT:
27252725
data = vt_get_kmsg_redirect();
2726-
ret = __put_user(data, p);
2726+
ret = put_user(data, p);
27272727
break;
27282728
case TIOCL_SETKMSGREDIRECT:
27292729
if (!capable(CAP_SYS_ADMIN)) {

0 commit comments

Comments
 (0)