From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933502AbcAYQMv (ORCPT ); Mon, 25 Jan 2016 11:12:51 -0500 Received: from lxorguk.ukuu.org.uk ([81.2.110.251]:43406 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932829AbcAYQMs (ORCPT ); Mon, 25 Jan 2016 11:12:48 -0500 Date: Mon, 25 Jan 2016 16:12:01 +0000 From: One Thousand Gnomes To: Dmitry Vyukov Cc: Greg Kroah-Hartman , Jiri Slaby , Daniel Vetter , David Herrmann , Peter Hurley , Imre Deak , "Lad, Prabhakar" , Nicolas Pitre , Nicholas Mc Guire , Scot Doyle , Denys Vlasenko , Takashi Iwai , LKML , syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin Subject: Re: tty: kmalloc size WARNING in vc_do_resize Message-ID: <20160125161201.5bf22992@lxorguk.ukuu.org.uk> In-Reply-To: References: Organization: Intel Corporation X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I think that either the kmalloc should use __GFP_NOWARN or > vc_do_resize should do stricter size check. vc_do_resize doesn't know enough to do a stricter size check. There are not many methods it calls but those are: vgacon_resize doesn't error when stupid things happen because of a silly hack for legacy svgatextmode tools. sisusbcon_resize does the right checks but we can get in a situation where we unplug during a resize so attempting to resize and size back might fail. fbcon_resize does the right thing, but again can error if we go size/resize/size back. That means we really have to guess or would have to add 'max size' info the structures. Right now it's clamped to 1Gbyte which is a 32767 x 32767 character display and probably ludicrous. Clamping to 4048 x 1024 chars would cover displays up to 16K x 6K even with the 4x6 font (which is insane on a 4K display, let alone 4 of them). Alan