vt: don't use kmalloc() for the unicode screen buffer
authorNicolas Pitre <nico@fluxnic.net>
Sun, 29 Mar 2020 02:25:11 +0000 (22:25 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Apr 2020 13:46:30 +0000 (15:46 +0200)
commit9a98e7a80f95378c9ee0c644705e3b5aa54745f1
tree0cb2689f274fa61f093e60a89f4f1c47b4aca8b3
parent66bb1c9518e623235cbaa7832c919eb4fe586cae
vt: don't use kmalloc() for the unicode screen buffer

Even if the actual screen size is bounded in vc_do_resize(), the unicode
buffer is still a little more than twice the size of the glyph buffer
and may exceed MAX_ORDER down the kmalloc() path. This can be triggered
from user space.

Since there is no point having a physically contiguous buffer here,
let's avoid the above issue as well as reducing pressure on high order
allocations by using vmalloc() instead.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Cc: <stable@vger.kernel.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://lore.kernel.org/r/nycvar.YSQ.7.76.2003282214210.2671@knanqh.ubzr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt.c