From: "Zi Yan" <ziy@nvidia.com>
To: "Alan Stern" <stern@rowland.harvard.edu>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"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>,
"Vlastimil Babka" <vbabka@kernel.org>,
"Suren Baghdasaryan" <surenb@google.com>,
"Michal Hocko" <mhocko@suse.com>,
"Brendan Jackman" <brendan.jackman@linux.dev>,
"Johannes Weiner" <hannes@cmpxchg.org>
Subject: Re: [syzbot] [mm?] WARNING in ep_write_iter
Date: Tue, 18 Aug 2026 19:45:31 -0400 [thread overview]
Message-ID: <DKSGX4MUL58E.1QQZGHROS8EPS@nvidia.com> (raw)
In-Reply-To: <15b086cc-7f10-4766-9b0c-88c3302e7398@rowland.harvard.edu>
On Mon Aug 17, 2026 at 11:12 PM EDT, Alan Stern wrote:
> On Mon, Aug 17, 2026 at 02:45:19PM -0400, Zi Yan wrote:
>> On 17 Aug 2026, at 11:37, Alan Stern wrote:
>> >>> Regardless, if it is important to let kernel developers know that their
>> >>> code is doing something wrong, why not make the WARN conditional on
>> >>> CONFIG_EXPERT or something similar? In other words, prevent it from
>> >>> crashing production systems.
>> >
>> > You didn't respond to this.
>>
>> I do not get your argument here. Why does this WARN need to be conditional
>> on CONFIG_EXPERT? What makes it special? Or you mean you want all WARNs
>> to be conditional CONFIG_EXPERT?
>
> This may be a moot point now, but I'll answer the questions anyway.
>
> This WARN should be conditional on something indicating that the kernel
> is meant for testing rather than production (not necessarily
> CONFIG_EXPERT but something like it) because it does not indicate that
> an operation has failed badly enough to leave the kernel in a
> dangerously unstable state. Rather, it indicates that a programmer has
> tried to do something that can't possibly succeed. The result should
> not be dangerous because the caller should always check kmalloc()'s
> return value. If the caller is unable to recover from a memory
> allocation failure then it is the caller's responsibility to WARN, not
> kmalloc()'s.
I agree with you that this situation, kmalloc cannot satisfy the
too-large-to-allocate request, is not fatal and is recoverable since the
caller handles NULL result. But without the warning, some callers have
no way to know if they are sending an unexpected/undesirable request
that might come from a bug in their code. With the patch, kmalloc
returning NULL means two ambiguous things: 1. the request cannot be
satisfied due to current memory system condition, e.g., insufficient
free memory; 2. the request itself is unreasonable/unexpected. It could
make debugging harder.
>
> The same is true for all other WARN statements. If they merely indicate
> a programming infelicity and not a dangerous failure then they should
> not fire in production kernels.
It is hard to tell whether a condition is dangerous or not. A caller
sending a too-large-to-allocate request can come from a miscalculation
or a wrong user input. It can also come from some data
corruption/overwrite, clobbering the request size itself.
--
Best Regards,
Yan, Zi
next prev parent reply other threads:[~2026-08-18 23:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <6a820ebc.9ebadd4d.20b15e.001b.GAE@google.com>
2026-08-16 20:52 ` [syzbot] [mm?] WARNING in ep_write_iter 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
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 [this message]
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-17 9:14 ` syzbot
2026-08-17 19:45 ` Zi Yan
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=DKSGX4MUL58E.1QQZGHROS8EPS@nvidia.com \
--to=ziy@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=brendan.jackman@linux.dev \
--cc=byungchul@sk.com \
--cc=david@kernel.org \
--cc=gourry@gourry.net \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.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=mhocko@suse.com \
--cc=rakie.kim@sk.com \
--cc=stern@rowland.harvard.edu \
--cc=surenb@google.com \
--cc=syzbot+805630f1453e490427fa@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=vbabka@kernel.org \
--cc=ying.huang@linux.alibaba.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