Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1317040

Re: tty: kmalloc size WARNING in vc_do_resize

From Dmitry Vyukov <dvyukov@google.com>
Newsgroups linux.kernel
Subject Re: tty: kmalloc size WARNING in vc_do_resize
Date 2016-01-25 18:10 +0100
Message-ID <qUSOm-7cE-15@gated-at.bofh.it> (permalink)
References <qUr1M-407-19@gated-at.bofh.it> <qUS1Y-6yn-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jan 25, 2016 at 5:12 PM, One Thousand Gnomes
<gnomes@lxorguk.ukuu.org.uk> wrote:
>> 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).


OK, then kmalloc call needs to include __GFP_NOWARN for cases when
size is too large (large than 8MB).

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

tty: kmalloc size WARNING in vc_do_resize Dmitry Vyukov <dvyukov@google.com> - 2016-01-24 12:30 +0100
  Re: tty: kmalloc size WARNING in vc_do_resize One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-01-25 17:20 +0100
    Re: tty: kmalloc size WARNING in vc_do_resize Dmitry Vyukov <dvyukov@google.com> - 2016-01-25 18:10 +0100

csiph-web