All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: syzbot <syzbot+882a85c0c8ec4a3e2281@syzkaller.appspotmail.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	syzkaller-bugs@googlegroups.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org
Subject: Re: [syzbot] WARNING in do_proc_bulk
Date: Mon, 3 May 2021 12:24:28 -0700	[thread overview]
Message-ID: <20210503122428.30ebfddbaf8f5184dc73e1a7@linux-foundation.org> (raw)
In-Reply-To: <20210503185614.GA628313@rowland.harvard.edu>

On Mon, 3 May 2021 14:56:14 -0400 Alan Stern <stern@rowland.harvard.edu> wrote:

> > 
> > do_proc_bulk() is asking kmalloc for more than MAX_ORDER bytes, in
> > 
> > 	tbuf = kmalloc(len1, GFP_KERNEL);
> 
> This doesn't seem to be a bug.  do_proc_bulk is simply trying to 
> allocate a kernel buffer for data passed to/from userspace.  If a user 
> wants too much space all at once, that's their problem.
> 
> As far as I know, the kmalloc API doesn't require the caller to filter 
> out requests for more the MAX_ORDER bytes.  Only to be prepared to 
> handle failures -- which do_proc_bulk is all set for.
> 
> Am I wrong about this?  Should we add __GFP_NOWARN to the gfp flags?

Yes, if the oversized request is a can-happen and the resulting error is handled
appropriately, __GFP_NOWARN is the way to go.

  reply	other threads:[~2021-05-03 19:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02 20:00 [syzbot] WARNING in do_proc_bulk syzbot
2021-05-02 20:00 ` syzbot
2021-05-03 10:25 ` syzbot
2021-05-03 10:25   ` syzbot
2021-05-03 17:53   ` Andrew Morton
2021-05-03 18:56     ` Alan Stern
2021-05-03 19:24       ` Andrew Morton [this message]
2021-05-04  0:47         ` Alan Stern
2021-05-04  1:07           ` syzbot
2021-05-04  1:07             ` syzbot

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=20210503122428.30ebfddbaf8f5184dc73e1a7@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=syzbot+882a85c0c8ec4a3e2281@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.