All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tty: fix memory leak in vc_deallocate
@ 2021-03-27 21:44 Pavel Skripkin
  2021-03-28  8:45 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Skripkin @ 2021-03-27 21:44 UTC (permalink / raw)
  To: gregkh, jirislaby
  Cc: linux-kernel, Pavel Skripkin, syzbot+bcc922b19ccc64240b42

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.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Reported-by: syzbot+bcc922b19ccc64240b42@syzkaller.appspotmail.com
---
 drivers/tty/vt/vt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 284b07224c55..0cc360da5426 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1381,6 +1381,7 @@ struct vc_data *vc_deallocate(unsigned int currcons)
 		atomic_notifier_call_chain(&vt_notifier_list, VT_DEALLOCATE, &param);
 		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);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tty: fix memory leak in vc_deallocate
  2021-03-27 21:44 [PATCH] tty: fix memory leak in vc_deallocate Pavel Skripkin
@ 2021-03-28  8:45 ` Greg KH
  2021-03-28  8:49   ` Pavel Skripkin
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2021-03-28  8:45 UTC (permalink / raw)
  To: Pavel Skripkin; +Cc: jirislaby, linux-kernel, syzbot+bcc922b19ccc64240b42

On Sun, Mar 28, 2021 at 12:44:43AM +0300, Pavel Skripkin wrote:
> 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.
> 
> Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> Reported-by: syzbot+bcc922b19ccc64240b42@syzkaller.appspotmail.com
> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tty: fix memory leak in vc_deallocate
  2021-03-28  8:45 ` Greg KH
@ 2021-03-28  8:49   ` Pavel Skripkin
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Skripkin @ 2021-03-28  8:49 UTC (permalink / raw)
  To: Greg KH; +Cc: jirislaby, linux-kernel, syzbot+bcc922b19ccc64240b42

Hi!
On Sun, 2021-03-28 at 10:45 +0200, Greg KH wrote:
> On Sun, Mar 28, 2021 at 12:44:43AM +0300, Pavel Skripkin wrote:
> > 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.
> > 
> > Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> > Reported-by: syzbot+bcc922b19ccc64240b42@syzkaller.appspotmail.com
> > ---
> >  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
> thanks,
> 
> greg k-h

-- 
With regards,
Pavel Skripkin



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-28  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-27 21:44 [PATCH] tty: fix memory leak in vc_deallocate Pavel Skripkin
2021-03-28  8:45 ` Greg KH
2021-03-28  8:49   ` Pavel Skripkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.