Messages in this thread | | | Date | Thu, 29 Aug 2019 08:01:38 +0200 | From | Michal Kubecek <> | Subject | Re: [PATCH] net: Adding parameter detection in __ethtool_get_link_ksettings. |
| |
On Tue, Aug 27, 2019 at 07:01:41PM +0000, Saeed Mahameed wrote: > On Mon, 2019-08-26 at 17:47 +0800, Dongxu Liu wrote: > > > Maybe "if (!dev->ethtool_ops)" is more accurate for this bug. > > > > Also i am not sure about this, could be a bug in the device driver your > enslaving. > > alloc_netdev_mqs will assign &default_ethtool_ops to dev->ethtool_ops , > if user provided setup callback didn't assign the driver specific > ethtool_ops.
Dongxu said he encountered the null pointer dereference in a 3.10 kernel, not current mainline. But commit 2c60db037034 ("net: provide a default dev->ethtool_ops") which introduced default_ethtool_ops came in 3.7-rc1 so 3.10 should have it already. There is indeed something wrong.
I don't think we should add either check unless we positively know that dev->ethtool_ops can be null with current mainline kernel. And even then, it would probably be more appropriate to fix the code which caused it.
Michal
| |