]> git.baikalelectronics.ru Git - kernel.git/commit
vt_ioctl: fix GIO_UNIMAP regression
authorJiri Slaby <jslaby@suse.cz>
Mon, 26 Oct 2020 05:54:19 +0000 (06:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Oct 2020 12:41:17 +0000 (13:41 +0100)
commit69ef46a19958e07835d717e4fb2c8faa860a03b5
tree29e1ff7994cd830e481be2410b63ef03d86e8067
parentdefe3903d0e8ab4a0c857cc70d2b6ccef77c8fc3
vt_ioctl: fix GIO_UNIMAP regression

In commit d78b2cd99e15, we shuffled with the check of 'perm'. But my
brain somehow inverted the condition in 'do_unimap_ioctl' (I thought
it is ||, not &&), so GIO_UNIMAP stopped working completely.

Move the 'perm' checks back to do_unimap_ioctl and do them right again.
In fact, this reverts this part of code to the pre-d78b2cd99e15 state.
Except 'perm' is now a bool.

Fixes: d78b2cd99e15 ("vt_ioctl: move perm checks level up")
Cc: stable@vger.kernel.org
Reported-by: Fabian Vogt <fvogt@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20201026055419.30518-1-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt_ioctl.c