]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1e49ff09b7e506f7c3f3d3714b6ab4e27c00f348
tree0cb2689f274fa61f093e60a89f4f1c47b4aca8b3
parentf327050ad2a622c9570bcfab0c7de70572ac926b
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