]> git.itanic.dy.fi Git - linux-stable/commit
vt: vt_ioctl: remove unnecessary console allocation checks
authorEric Biggers <ebiggers@google.com>
Mon, 24 Feb 2020 08:03:26 +0000 (00:03 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2020 06:02:31 +0000 (08:02 +0200)
commit4e1c0484b7f84f55713b1eb1faf641ae49496bb1
tree4e605815625809e6e78fd5eba9e5b09684fdf483
parente50d4c4fecccef226a86e2a6be20ad376138e9ec
vt: vt_ioctl: remove unnecessary console allocation checks

commit 1aa6e058dd6cd04471b1f21298270014daf48ac9 upstream.

The vc_cons_allocated() checks in vt_ioctl() and vt_compat_ioctl() are
unnecessary because they can only be reached by calling ioctl() on an
open tty, which implies the corresponding virtual console is allocated.

And even if the virtual console *could* be freed concurrently, then
these checks would be broken since they aren't done under console_lock,
and the vc_data is dereferenced before them anyway.

So, remove these unneeded checks to avoid confusion.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20200224080326.295046-1-ebiggers@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt_ioctl.c