tty: fix memory leak in vc_deallocate
authorPavel Skripkin <paskripkin@gmail.com>
Sat, 27 Mar 2021 21:44:43 +0000 (00:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:39 +0000 (14:47 +0200)
commitb1c953dc853a372ff534a5c67962caa31d219939
tree4a7e81987c88ced996d6d88ce9e7177b6a88b7cc
parent25e9c2c1173507f620d475b2e31503c0150d2338
tty: fix memory leak in vc_deallocate

commit 211b4d42b70f1c1660feaa968dac0efc2a96ac4d upstream.

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.

Reported-by: syzbot+bcc922b19ccc64240b42@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210327214443.21548-1-paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt.c