Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp281637ybj; Wed, 6 May 2020 17:34:35 -0700 (PDT) X-Google-Smtp-Source: APiQypLbGQ+3V2iBsFbU7yhqiDINzcMblH7x7TDVAvMxzcwHASDOaBgMcct7rM9+6EVZbkzFA8CS X-Received: by 2002:a17:906:1659:: with SMTP id n25mr3040607ejd.122.1588811674980; Wed, 06 May 2020 17:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588811674; cv=none; d=google.com; s=arc-20160816; b=otzirDPmjCELlXRZLk14X+cyv4gIaBS2RGzgedkuF4IhQv5ftj+Rv9Xkz8I1kITdCF 2dM3U49l7VtRIq213GCpmIwQvA9mQw0E5CRsRC9n4v+M68CO0Yg5Z1TBRhm7Z0SntKEk Yaln70lY/eAjAqG3KSLNOC64IJ2zvB14TJVSAo+iPVhwg/yEzbTUoxscneZ/6w/lHZ/H anX//JO8maR83q04lkrC9FDwmc1pDt9Oo/MTybf5pjhjvI8SfbVSUqNqgRLuzQS4iU6V Tiyrfaxq2u0HwmiUwosw5fSbzXgbHODU/tJa14xRLQE5qxv9MVitnI2OG0B8pedgCJ80 oUmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=yTmDwtbmITALy1GdBof9D1oRF7DrR9a/MUeqxBdU2Ro=; b=UUw0Jqmb6nVGcidIRtdFfAFFv6tCxdxS6Zq4Cns2clGN/hooUa0P5o3lVpy2FEhRYa iLtdxHPTAg7Do2qniH/Zag8jkhQcd/+OgbR6SRg6B1wbR9klsxsbg0Gvijf7Htq2Y/Ip QDXU1s+6WWLl8BnnspiNeVyP5YgYS46BMZv7J3KD1Fdrbvz+n5hOWgsCkcCK1bOIfaLp qEhiLAd+8aIOwRbyMe7IFxiXGu5RRKSLfonTZZ0FWV4sZlVLvdKIyT1ZCcAodo8CQt+I 3HBbiOFrSHc7UKrlMb8l1PkW6OcY1Mm4QM++jfrMO7unZGJiMUWU6FNTZz3fQB52Zrhd gspg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a88si2256882edf.379.2020.05.06.17.34.11; Wed, 06 May 2020 17:34:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727088AbgEGAci (ORCPT + 99 others); Wed, 6 May 2020 20:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbgEGAch (ORCPT ); Wed, 6 May 2020 20:32:37 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99700C061A0F; Wed, 6 May 2020 17:32:37 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id DDCA01277CC95; Wed, 6 May 2020 17:32:35 -0700 (PDT) Date: Wed, 06 May 2020 17:32:34 -0700 (PDT) Message-Id: <20200506.173234.92268086246049661.davem@davemloft.net> To: f.fainelli@gmail.com Cc: netdev@vger.kernel.org, allen.pais@oracle.com, andrew@lunn.ch, vivien.didelot@gmail.com, kuba@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: dsa: Do not leave DSA master with NULL netdev_ops From: David Miller In-Reply-To: <20200504201806.27192-1-f.fainelli@gmail.com> References: <20200504201806.27192-1-f.fainelli@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 06 May 2020 17:32:36 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Fainelli Date: Mon, 4 May 2020 13:18:06 -0700 > When ndo_get_phys_port_name() for the CPU port was added we introduced > an early check for when the DSA master network device in > dsa_master_ndo_setup() already implements ndo_get_phys_port_name(). When > we perform the teardown operation in dsa_master_ndo_teardown() we would > not be checking that cpu_dp->orig_ndo_ops was successfully allocated and > non-NULL initialized. > > With network device drivers such as virtio_net, this leads to a NPD as > soon as the DSA switch hanging off of it gets torn down because we are > now assigning the virtio_net device's netdev_ops a NULL pointer. > > Fixes: da7b9e9b00d4 ("net: dsa: Add ndo_get_phys_port_name() for CPU port") > Reported-by: Allen Pais > Signed-off-by: Florian Fainelli Applied and queued up for -stable, thanks Florian.