diff options
author | Pavel Skripkin <paskripkin@gmail.com> | 2021-03-28 00:44:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-11 14:04:17 +0200 |
commit | 55aa314a1a6cd96b3a048093cd37d32c10ca0928 (patch) | |
tree | e8f29b0b66ee15c8b2bfcb64dae4703b03f17890 /drivers/tty | |
parent | 943131fda33bfe0dbe9e6bf96b00468deda7da10 (diff) | |
download | linux-stable-55aa314a1a6cd96b3a048093cd37d32c10ca0928.tar.gz linux-stable-55aa314a1a6cd96b3a048093cd37d32c10ca0928.tar.bz2 linux-stable-55aa314a1a6cd96b3a048093cd37d32c10ca0928.zip |
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>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/vt/vt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index c55b6d7ccaf7..564e1fa2e4c9 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1377,6 +1377,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); |