Re: [syzbot] [mm?] WARNING in ep_write_iter

Alan Stern <[email protected]>
Newsgroups org.kernel.vger.linux-usb,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
On Mon, Aug 17, 2026 at 11:22:47AM -0400, Zi Yan wrote:
> > Again, I disagree with some of the details of this argument in this
> > context.  For instance, if all kernel developers are supposed to know
> > that they shouldn't ask kmalloc() for more than MAX_PAGE_ORDER at the
> > risk of provoking a WARN, if this is such an important restriction, then
> > shouldn't this requirement be mentioned in the kerneldoc for kmalloc()?
> 
> 
> kmalloc is the normal method of allocating memory
> for objects smaller than page size in the kernel.

This means when you are allocating small objects, kmalloc is the normal 
way to do it.  It says nothing about what you should do when allocating 
large objects.

In particular, it doesn't say that if you ask kmalloc for more than 4 MB 
of memory, your system is likely to crash.

> See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/slab.h?h=v7.2#n1001
> 
> In this case, kmalloc is used to request > 4MB memory.
> 
> >
> > 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.

Alan Stern
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.