fbdev: fbcon: release buffer when fbcon_do_set_font() failed
commit3c3bfb8586
upstream. syzbot is reporting memory leak at fbcon_do_set_font() [1], for commita5a923038d
("fbdev: fbcon: Properly revert changes when vc_resize() failed") missed that the buffer might be newly allocated by fbcon_set_font(). Link: https://syzkaller.appspot.com/bug?extid=25bdb7b1703639abd498 [1] Reported-by: syzbot <syzbot+25bdb7b1703639abd498@syzkaller.appspotmail.com> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Tested-by: syzbot <syzbot+25bdb7b1703639abd498@syzkaller.appspotmail.com> Fixes:a5a923038d
("fbdev: fbcon: Properly revert changes when vc_resize() failed") CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
ca8bcb348a
Коммит
88ec6d1105
|
@ -2462,7 +2462,8 @@ err_out:
|
||||||
|
|
||||||
if (userfont) {
|
if (userfont) {
|
||||||
p->userfont = old_userfont;
|
p->userfont = old_userfont;
|
||||||
REFCOUNT(data)--;
|
if (--REFCOUNT(data) == 0)
|
||||||
|
kfree(data - FONT_EXTRA_WORDS * sizeof(int));
|
||||||
}
|
}
|
||||||
|
|
||||||
vc->vc_font.width = old_width;
|
vc->vc_font.width = old_width;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче