]> git.baikalelectronics.ru Git - kernel.git/commit
vt: fix unicode console freeing with a common interface
authorNicolas Pitre <nico@fluxnic.net>
Sat, 2 May 2020 15:01:07 +0000 (11:01 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 May 2020 09:49:59 +0000 (11:49 +0200)
commit806b8b519b6a74912d6a1ca9b1c4e5a1f64489fe
treeb807b3654d8da30cf43cc7f3843870b8d90ec63b
parentca7cef47f52978cd7d47449fe6f463f63a601bf3
vt: fix unicode console freeing with a common interface

By directly using kfree() in different places we risk missing one if
it is switched to using vfree(), especially if the corresponding
vmalloc() is hidden away within a common abstraction.

Oh wait, that's exactly what happened here.

So let's fix this by creating a common abstraction for the free case
as well.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Reported-by: syzbot+0bfda3ade1ee9288a1be@syzkaller.appspotmail.com
Fixes: 1e49ff09b7e5 ("vt: don't use kmalloc() for the unicode screen buffer")
Cc: <stable@vger.kernel.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://lore.kernel.org/r/nycvar.YSQ.7.76.2005021043110.2671@knanqh.ubzr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt.c