The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.47.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-693.21.1.vz7.47.6 ------> commit f0e9468c19222f0acc3e264643d43dfefae1d8b6 Author: Dmitry Vyukov <dvyu...@google.com> Date: Wed May 16 11:09:24 2018 +0300
ms/tty: limit terminal size to 4M chars Size of kmalloc() in vc_do_resize() is controlled by user. Too large kmalloc() size triggers WARNING message on console. Put a reasonable upper bound on terminal size to prevent WARNINGs. Signed-off-by: Dmitry Vyukov <dvyu...@google.com> CC: David Rientjes <rient...@google.com> Cc: One Thousand Gnomes <gno...@lxorguk.ukuu.org.uk> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Cc: Jiri Slaby <jsl...@suse.com> Cc: Peter Hurley <pe...@hurleysoftware.com> Cc: linux-ker...@vger.kernel.org Cc: syzkal...@googlegroups.com Cc: stable <sta...@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> ms commit 32b2921e6a7461fe63b71217067a6cf4bddb132f https://jira.sw.ru/browse/HCI-53 Signed-off-by: Oleg Babin <oba...@virtuozzo.com> --- drivers/tty/vt/vt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index fbc6290e417a..b49abe57b05f 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -871,6 +871,8 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, if (new_cols == vc->vc_cols && new_rows == vc->vc_rows) return 0; + if (new_screen_size > (4 << 20)) + return -EINVAL; newscreen = kmalloc(new_screen_size, GFP_USER); if (!newscreen) return -ENOMEM; _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel