mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	David Herrmann <dh.herrmann@gmail.com>,
	Peter Hurley <peter@hurleysoftware.com>,
	Imre Deak <imre.deak@intel.com>,
	"Lad, Prabhakar" <prabhakar.csengg@gmail.com>,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	Nicholas Mc Guire <hofrat@osadl.org>,
	Scot Doyle <lkml14@scotdoyle.com>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	Takashi Iwai <tiwai@suse.de>, LKML <linux-kernel@vger.kernel.org>,
	syzkaller <syzkaller@googlegroups.com>,
	Kostya Serebryany <kcc@google.com>,
	Alexander Potapenko <glider@google.com>,
	Sasha Levin <sasha.levin@oracle.com>
Subject: Re: tty: kmalloc size WARNING in vc_do_resize
Date: Mon, 25 Jan 2016 16:12:01 +0000	[thread overview]
Message-ID: <20160125161201.5bf22992@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <CACT4Y+a0pD2JUkuxugcmnLNPv3a0MK_51Gb0fqNqGYQjJLNBnA@mail.gmail.com>

> 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

  reply	other threads:[~2016-01-25 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-24 11:24 Dmitry Vyukov
2016-01-25 16:12 ` One Thousand Gnomes [this message]
2016-01-25 17:02   ` Dmitry Vyukov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160125161201.5bf22992@lxorguk.ukuu.org.uk \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dh.herrmann@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hofrat@osadl.org \
    --cc=imre.deak@intel.com \
    --cc=jslaby@suse.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml14@scotdoyle.com \
    --cc=nicolas.pitre@linaro.org \
    --cc=peter@hurleysoftware.com \
    --cc=prabhakar.csengg@gmail.com \
    --cc=sasha.levin@oracle.com \
    --cc=syzkaller@googlegroups.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®