3.2.85-rc1 review patch. If anyone has any objections, please let me know.
------------------ From: Dmitry Vyukov <dvyu...@google.com> commit 32b2921e6a7461fe63b71217067a6cf4bddb132f upstream. 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-kernel@vger.kernel.org Cc: syzkal...@googlegroups.com Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> Signed-off-by: Ben Hutchings <b...@decadent.org.uk> --- drivers/tty/vt/vt.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -882,6 +882,8 @@ static int vc_do_resize(struct tty_struc 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;