From: Andrew Morton <akpm@linux-foundation.org>
To: "Zi Yan" <ziy@nvidia.com>
Cc: "Alan Stern" <stern@rowland.harvard.edu>,
"syzbot" <syzbot+805630f1453e490427fa@syzkaller.appspotmail.com>,
<apopple@nvidia.com>, <byungchul@sk.com>, <david@kernel.org>,
<gourry@gourry.net>, <joshua.hahnjy@gmail.com>,
<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
<matthew.brost@intel.com>, <rakie.kim@sk.com>,
<syzkaller-bugs@googlegroups.com>, <ying.huang@linux.alibaba.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
<linux-usb@vger.kernel.org>
Subject: Re: [syzbot] [mm?] WARNING in ep_write_iter
Date: Sun, 16 Aug 2026 19:42:13 -0700 [thread overview]
Message-ID: <20260816194213.0e813ed338144ebc81ed4050@linux-foundation.org> (raw)
In-Reply-To: <DKQU9SQUIKDR.2KEZZPONJ1IJ7@nvidia.com>
On Sun, 16 Aug 2026 21:47:58 -0400 "Zi Yan" <ziy@nvidia.com> wrote:
> >
> >> > I prefer Andrew's first suggestion. If the user asks the kernel to copy
> >> > too much data, just fail -- with no warning.
> >>
> >> __GFP_WARN gets rid of all other warnings, even if user asks for a
> >> reasonable size. Why use such a big hammer?
> >
> > Because on many systems, WARN causes the kernel to crash. You don't
> > want the entire system to crash just because the user asked for more
> > memory than was available.
>
> User asking for more memory that what is available is pretty common and
> should not trigger a WARN or crash, unless you have panic_on_oom set.
I assume Alan is referring to panic_on_warn.
Heaven knows how common panic_on_warn usage is. Gemini tells me "There
is no exact global headcount or precise user metric for how many people
use panic_on_warn. However, the setting is widely enabled across a few
billion Android devices and many cloud/server provider host kernels
where automated failover makes a full reboot preferable to running with
an unknown warning state".
So I do think that WARNs are more serious than we (mm developers) tend
to assume.
So we just shouldn't permit userspace to trivially trigger a
page-allocation WARN. Especially if the caller is perfectly capable of
handling an ENOMEM allocation failure, as appears to be the case with
usb-gadget.
(Does usb-gadget actually get used by Android? Surely not by cloud
providers!)
(Can this WARN be triggered by unprivileged userspace? I didn't look,
this matters a lot).
> You can mmap a virtual address range bigger than your physical memory
> size plus your swap space and try to fault all pages in. That would
> cause OOM and the system should not crash.
Right. As long as it doesn't trigger a WARN!
Perhaps we should revisit this.
Why are we emitting a WARN if an allocation fails, given that this will
often panic the kernel? Should we on the core MM side dial that back
to a pr_warn() and a helpful backtrace?
next prev parent reply other threads:[~2026-08-17 2:42 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-16 19:25 [syzbot] [mm?] WARNING in ep_write_iter syzbot
2026-08-16 20:52 ` Andrew Morton
2026-08-16 21:47 ` Zi Yan
2026-08-16 23:32 ` Alan Stern
2026-08-17 0:13 ` Zi Yan
2026-08-17 1:15 ` Alan Stern
2026-08-17 1:47 ` Zi Yan
2026-08-17 2:42 ` Andrew Morton [this message]
2026-08-17 13:55 ` Alan Stern
2026-08-17 14:34 ` Zi Yan
2026-08-17 14:37 ` Zi Yan
2026-08-17 15:06 ` Alan Stern
2026-08-17 15:22 ` Zi Yan
2026-08-17 15:37 ` Alan Stern
2026-08-17 18:45 ` Zi Yan
2026-08-18 3:12 ` Alan Stern
2026-08-18 23:45 ` Zi Yan
2026-08-19 1:30 ` Alan Stern
2026-08-17 15:06 ` Greg Kroah-Hartman
2026-08-17 15:19 ` Zi Yan
2026-08-17 15:55 ` Greg Kroah-Hartman
2026-08-17 18:51 ` Zi Yan
2026-08-17 20:34 ` John Hubbard
2026-08-20 13:55 ` Zi Yan
2026-08-20 13:59 ` Zi Yan
2026-08-20 14:27 ` Alan Stern
2026-08-21 8:30 ` David Laight
2026-08-21 14:24 ` Zi Yan
2026-08-21 15:13 ` David Laight
2026-08-21 15:31 ` Zi Yan
2026-08-17 9:14 ` syzbot
2026-08-17 19:45 ` Zi Yan
2026-08-17 19:59 ` syzbot
2026-08-20 13:15 ` Zi Yan
2026-08-20 13:30 ` 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=20260816194213.0e813ed338144ebc81ed4050@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=byungchul@sk.com \
--cc=david@kernel.org \
--cc=gourry@gourry.net \
--cc=gregkh@linuxfoundation.org \
--cc=joshua.hahnjy@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-usb@vger.kernel.org \
--cc=matthew.brost@intel.com \
--cc=rakie.kim@sk.com \
--cc=stern@rowland.harvard.edu \
--cc=syzbot+805630f1453e490427fa@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=ying.huang@linux.alibaba.com \
--cc=ziy@nvidia.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.