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

From: Miquel Raynal

Date: Sun Sep 20 2026 - 08:53:00 EST


Hi Jörn,

>> > 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.

Not saying this would be a bad move, it would be highly inconsistent
with the current code base. Every single allocation in the kernel is
checked. Such a change, without a documented and agreed upon method,
would lead to dozens fuzzing AIs sending patches to add the "missing"
check.

Thanks,
Miquèl