Re: [PATCH v2] net: rtnetlink: Fix rtnl_dereference may be return NULL
From: Eric Dumazet
Date: Thu Jul 08 2021 - 08:26:45 EST
On 7/8/21 1:11 PM, Vladimir Oltean wrote:
> On Thu, Jul 08, 2021 at 11:43:20AM +0200, Johannes Berg wrote:
>> On Thu, 2021-07-08 at 17:29 +0800, Yajun Deng wrote:
>>> The value 'link' may be NULL in rtnl_unregister(), this leads to
>>> kfree_rcu(NULL, xxx), so add this case handling.
>> I don't see how. It would require the caller to unregister something
>> they never registered. That would be a bug there, but I don't see that
>> it's very useful to actually be defensive about bugs there.
> Besides, isn't kfree_rcu(NULL) safe anyway?
Only from linux-5.3 I think.
(commit 12edff045bc6dd3ab1565cc02fa4841803c2a633 was not backported to old kernels)
But yes, this patch is not solving any bug, as I suspected.