Re: [PATCH net] net: ping6: Fix possible leaked pernet namespace in pingv6_init()

From: Eric Dumazet
Date: Thu Nov 03 2022 - 21:57:37 EST


On Thu, Nov 3, 2022 at 6:36 PM Chen Zhongjin <chenzhongjin@xxxxxxxxxx> wrote:
>
> Hi,
>
> On 2022/11/4 0:58, Kuniyuki Iwashima wrote:
> > From: Chen Zhongjin <chenzhongjin@xxxxxxxxxx>
> > Date: Thu, 3 Nov 2022 17:03:45 +0800
> >> When IPv6 module initializing in pingv6_init(), inet6_register_protosw()
> >> is possible to fail but returns without any error cleanup.
> > The change itself looks sane, but how does it fail ?
> > It seems inet6_register_protosw() never fails for pingv6_protosw.
> > Am I missing something ?
>
> Thanks for reminding! I only injected error return value for functions
> but didn't notice the inner logic.
>
> Rechecked and find you are right that inet6_register_protosw() is safe
> for this case.
>
> Sorry for bothering, please reject this. Will check carefully next time.

This is silly and a waste of time for many of us.

If you want to send fixes for real bugs, I suggest you grab reports
from syzbot queues,
instead of 'injecting error values' from arbitrary functions.

Thanks.