tty/vt: check allocation size in con_set_unimap()
authorDenis Efremov <efremov@linux.com>
Wed, 3 Jun 2020 10:28:04 +0000 (13:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:11:58 +0000 (17:11 +0200)
commit5de30b286e7166164f9e45de991bde26f5db8298
treed173cc37c6d1f5eca98bd7029327fce9f757b53a
parent5ba1278787225629fb0b58de768e744714215678
tty/vt: check allocation size in con_set_unimap()

The vmemdup_user() function has no 2-factor argument form. Use array_size()
to check for the overflow.

Signed-off-by: Denis Efremov <efremov@linux.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20200603102804.2110817-1-efremov@linux.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/consolemap.c