Re: [syzbot] [fs?] possible deadlock in ovl_create_object (2)

From: Jörn Engel

Date: Sat Sep 19 2026 - 11:39:03 EST


On Sat, Sep 19, 2026 at 08:58:51PM +0530, Chris Roy wrote:
>
> I'd rather not bolt a redesign onto this fix.

Good decision!

> > Is this check necessary? [...] Looks like the kernel is still
> > undecided whether checks are necessary or not.
>
> I will keep it. kzalloc()/kstrdup() under plain GFP_KERNEL can still
> return NULL under real memory pressure (no __GFP_NOFAIL here), and
> dropping it would be inconsistent with the kstrdup() check two lines
> below.

My foggy mind is slowly waking up. GFP_ATOMIC can return NULL. If
you're trying to allocate memory from an interrupt handler or similar,
you cannot afford to wait for memory reclaim to happen. Those calls
definitely need a check and a reasonable plan what to do in case of
failure.

GFP_KERNEL should be able to block and wait, so there really is no
excuse for kmalloc to return NULL or for the callers to need a check.

But your decision of not pulling too many decisions into a single patch
is still a good decision. Even if my logic is sound, removing checks
from kmalloc callers should be a separate effort.

Jörn

--
I don't understand it. Nobody does.
-- Richard P. Feynman