tty: fix memory leak in vc_deallocate
PATCH 1/1 tty: fix memory leak in vc_deallocate
syzbot reported memory leak in tty/vt.
The problem was in VT_DISALLOCATE ioctl cmd. After allocating unimap with PIO_UNIMAP it wasn't freed via VT_DISALLOCATE, but vc_cons[currcons].d was zeroed.
--- drivers/tty/vt/vt.c | 1 + 1 file changed, 1 insertion(+)
drivers/tty/vt/vt.c +1 -0
@@ -1381,6 +1381,7 @@ struct vc_data *vc_deallocate(unsigned int currcons)atomic_notifier_call_chain (&vt_notifier_list,VT_DEALLOCATE , ¶m);vcs_remove_sysfs (currcons);visual_deinit (vc); +con_free_unimap (vc);put_pid (vc->vt_pid);vc_uniscr_set (vc,NULL );kfree (vc->vc_screenbuf);
Signature · 1 line
2.30.2
Greg KH
maintainerQuoted 11 lines · Pavel Skripkin
syzbot reported memory leak in tty/vt.
The problem was inVT_DISALLOCATEioctl cmd. After allocating unimap withPIO_UNIMAPit wasn't freed viaVT_DISALLOCATE, but vc_cons[currcons].d was zeroed.Signed-off-by Pavel Skripkin <[email protected]>Reported-by [email protected]--- drivers/tty/vt/vt.c | 1 + 1 file changed, 1 insertion(+)
Is this patch tested by syzbot to fix the problem?
thanks,
greg k-h
Hi!
Quoted 7 lines · Greg KH
Quoted 6 lines · Pavel Skripkin
syzbot reported memory leak in tty/vt.
The problem was inVT_DISALLOCATEioctl cmd. After allocating unimap withPIO_UNIMAPit wasn't freed viaVT_DISALLOCATE, but vc_cons[currcons].d was zeroed.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Pavel Skripkin <[email protected]>Reported-by [email protected]---
drivers/tty/vt/vt.c | 1 +1 file changed, 1 insertion(+)Is this patch tested by syzbot to fix the problem?
Yeah, it's tested.
https://syzkaller.appspot.com/bug?id=083cb8bd8468537151a57339ae72d505bb5bded0
Quoted 3 lines
thanks,
greg k-h
Signature · 2 lines
With regards, Pavel Skripkin