Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1845522ybl; Wed, 28 Aug 2019 23:02:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpLS5yjTnzDEAjsrDTYNhFLGxzbZuBaMv4c5zoo+La6I3o4swt2UOxAgnwkmiRnyAp9VhB X-Received: by 2002:a17:90a:2ecb:: with SMTP id h11mr7877627pjs.108.1567058573955; Wed, 28 Aug 2019 23:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567058573; cv=none; d=google.com; s=arc-20160816; b=zqHR4Jmw+yohU21iALO6KwzCdWNjXowRRfX8o03Cv6jvNUiAmKYy/pm3kFz3cUWJb7 lNz44dKjmBDY/R+2X5Ep2D37NE2cSPmW5AckYu/Is/gQm8eMBSZzEDgV3krchphpuM1i SO166QOAx2omJ2nLaJAfKEnKTS0/Hol01lothOYB6xBZEMqWLa2PQ9Y/9NYl/no7nmps 3Zsagvq+HeOm2XOIu/09UxAOqNd2lIYkVVtopTiL0n0faG2WiiNjUM2gg3VQ+4okV0mc jMETdzoXMkSK/aWJPzoJGqk1AvQQ6BEGTE8/pR/IMXe+MAL+3Bl2nWjnqut6fHVm6yZm y8lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0fOMN9kKVLf1aGDoW3DC6Mm1TcnW/K8PREC22Z4PYLw=; b=d8fWWUZUDUATxUcuyDn63qSXUBO8HOus20COuM84fD5DZZHl/vFAXmua3tDBqlZ9ob qLJRtKdJx2MU/+7awnoiVpnfYFrQSgYjl6rRIXLyxBhwKq1vtEAXRfLIjt+/MvEAhi04 Ymy8j8HK5epq/bh3e4284bjZ35kvv3bxLvekskhiSzu0HVT26BrpVsaARse2mz3RC4YT J3PHAtS30RG4ISGBZGPJ5AtejDrPzB3UktavjBtamT/AnAfZehnkOsFNQoLBItWOIYZH MmWgkn/PFY/mHbXNslj076KPSziLrbMsZTA+MsoTC+neacSPaz+BoOCl1LjemZr2zGWd lkRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s23si1006099plp.360.2019.08.28.23.02.36; Wed, 28 Aug 2019 23:02:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727330AbfH2GBl (ORCPT + 99 others); Thu, 29 Aug 2019 02:01:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:48676 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725776AbfH2GBk (ORCPT ); Thu, 29 Aug 2019 02:01:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6C728AE12; Thu, 29 Aug 2019 06:01:39 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 74969E0CFC; Thu, 29 Aug 2019 08:01:38 +0200 (CEST) Date: Thu, 29 Aug 2019 08:01:38 +0200 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Saeed Mahameed , "liudongxu3@huawei.com" , "eric.dumazet@gmail.com" , "davem@davemloft.net" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] net: Adding parameter detection in __ethtool_get_link_ksettings. Message-ID: <20190829060138.GL29594@unicorn.suse.cz> References: <20190826094705.10544-1-liudongxu3@huawei.com> <0db9e18a4dd81d9a6025a2d8cda343b585d91fc4.camel@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0db9e18a4dd81d9a6025a2d8cda343b585d91fc4.camel@mellanox.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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