Re: [PATCH] ipv4: nexthop: Fix deadcode issue by performing a proper NULL check

From: Nikolay Aleksandrov
Date: Sun Jun 07 2020 - 04:20:42 EST


On 03/06/2020 00:01, David Miller wrote:
> From: Nikolay Aleksandrov <nikolay@xxxxxxxxxxxxxxxxxxx>
> Date: Tue, 2 Jun 2020 10:23:09 +0300
>
>> On 01/06/2020 21:06, David Miller wrote:
>>> From: patrickeigensatz@xxxxxxxxx
>>> Date: Mon, 1 Jun 2020 13:12:01 +0200
>>>
>>>> From: Patrick Eigensatz <patrickeigensatz@xxxxxxxxx>
>>>>
>>>> After allocating the spare nexthop group it should be tested for kzalloc()
>>>> returning NULL, instead the already used nexthop group (which cannot be
>>>> NULL at this point) had been tested so far.
>>>>
>>>> Additionally, if kzalloc() fails, return ERR_PTR(-ENOMEM) instead of NULL.
>>>>
>>>> Coverity-id: 1463885
>>>> Reported-by: Coverity <scan-admin@xxxxxxxxxxxx>
>>>> Signed-off-by: Patrick Eigensatz <patrickeigensatz@xxxxxxxxx>
>>>
>>> Applied, thank you.
>>>
>>
>> Hi Dave,
>> I see this patch in -net-next but it should've been in -net as I wrote in my
>> review[1]. This patch should go along with the recent nexthop set that fixes
>> a few bugs, since it could result in a null ptr deref if the spare group cannot
>> be allocated.
>> How would you like to proceed? Should it be submitted for -net as well?
>
> When I'm leading up to the merge window I just toss everything into net-next
> and still queue things to -stable as needed.
>

Got it, in that case could you please queue the patch for -stable?

I checked https://patchwork.ozlabs.org/bundle/davem/stable/?state=* and
https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git
but didn't find it.

Thanks,
Nik