From: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: David Rientjes <rientjes@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
Peter Hurley <peter@hurleysoftware.com>,
LKML <linux-kernel@vger.kernel.org>,
syzkaller <syzkaller@googlegroups.com>,
Kostya Serebryany <kcc@google.com>,
Alexander Potapenko <glider@google.com>
Subject: Re: [PATCH] tty: use __GFP_NOWARN for user-controlled kmalloc
Date: Fri, 5 Feb 2016 10:35:24 +0000 [thread overview]
Message-ID: <20160205103524.2a35ffff@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <CACT4Y+Zj29ZmsUZCR7FhkxMz_kdV51qhp3SwJ31Sj40y=A7W0w@mail.gmail.com>
On Fri, 5 Feb 2016 08:06:12 +0100
Dmitry Vyukov <dvyukov@google.com> wrote:
> On Thu, Feb 4, 2016 at 11:11 PM, David Rientjes <rientjes@google.com> wrote:
> > On Thu, 4 Feb 2016, Dmitry Vyukov wrote:
> >
> >> Size of kmalloc() in vc_do_resize() is controlled by user.
> >> Too large kmalloc() size triggers WARNING message on console.
> >>
> >> Use __GFP_NOWARN for this kmalloc() to not scare admins.
> >>
> >
> > Hmm, this is hitting the WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN)) for
> > order >= MAX_ORDER.
> >
> > vc_do_resize() has
> >
> > if (cols > VC_RESIZE_MAXCOL || lines > VC_RESIZE_MAXROW)
> > return -EINVAL;
> >
> > so the appropriate fix would seem to be to reject sizes that would exceed
> > the page allocator's ability to return contiguous memory (MAX_ORDER)
> > rather than ever trying the allocation in the first place.
>
> Hi David,
>
> Please see Alan response to original report here:
> https://groups.google.com/d/msg/syzkaller/ufjvr5j0URo/lTlpYP0DBQAJ
> I can't say that I fully understand it.
I think we can go down to something like cols * lines < 4MB with complete
safety.
Alan
prev parent reply other threads:[~2016-02-05 10:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-04 15:55 [PATCH] tty: use __GFP_NOWARN for user-controlled kmalloc() Dmitry Vyukov
2016-02-04 17:49 ` Peter Hurley
2016-02-04 18:28 ` [PATCH] tty: use __GFP_NOWARN for user-controlled kmalloc Dmitry Vyukov
2016-02-04 22:11 ` David Rientjes
2016-02-05 7:06 ` Dmitry Vyukov
2016-02-05 10:32 ` David Rientjes
2016-02-05 10:35 ` One Thousand Gnomes [this message]
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=20160205103524.2a35ffff@lxorguk.ukuu.org.uk \
--to=gnomes@lxorguk.ukuu.org.uk \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kcc@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peter@hurleysoftware.com \
--cc=rientjes@google.com \
--cc=syzkaller@googlegroups.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).