Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp7965056ybn; Tue, 1 Oct 2019 00:39:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsUlteC+aPLw3/VQQznx9ZpviL/kCNkTSzgYTzC7fd1dzwskeoqxbKGeK5kP67lLmwMJVA X-Received: by 2002:a50:e613:: with SMTP id y19mr24141480edm.290.1569915594121; Tue, 01 Oct 2019 00:39:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569915594; cv=none; d=google.com; s=arc-20160816; b=sv7uynfwow5DSZBDIRF7bc05R3QmQ3ejrWTtkMxVJqpVoqG1nQZB8yXp5kbi5+P15j GI3xiPTbNS/0jDRI8ZB3iZ49uZcdMmXke7XNEeQwvp+5hSV+jDJV6gXGln92UFwG0W8Z WvrxVRkGE8VeeN83KobU/NfffeQWym5TjGFdakonLRhvRevHRj96YKpkwKLdW04DYweP 2X8vcV7TFGiemFuuLNJzQDmwIX5uE3rTuIUL5p1yxd2iLB+V53ep7hFK4QV/Tx1cNZs8 UtKAmO9y3k3CIuBiRvO0HtFbWUEByrN+ETnzLbDRwHBtrTCSzCUhkFr7816WEeBijS1t bBwQ== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=xAWNf+MRqQSvK+et/CM1EKkuM92nzCgO/W6/1owjVEE=; b=W3tx21TjB5qUonPF/J3E7U6mAxt8dKA/sgPvHSqC8inemQW5cRlec6W7bwjCOqlS+s JknzROqKHpc7MOeoNR9jWk8hSQvJHkffl8qhpQmxlCuJQ7Bg9lf/Zk5LDUfv/y3ooAZi QGlmZFEB0B78z8uyp6G7k1CaK74reQ1Xqr5UhYJwMz24bMVABlZPJk+N3EoOLJsgU98F nzYZBPCXm4K0RXgeH2zed5w6k/9GLkj8EJwm0+/aG6YW8DIrMNss2cyKXbgGMGZtNYxG c16LeHVX1d+TDGYhyGr2M3rP3NxrjAa+fv8YPPPskTGa9gbH5Vbd+cqqui4lPyT4OC0U 4Ogw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 d25si8452644edq.65.2019.10.01.00.39.28; Tue, 01 Oct 2019 00:39:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730051AbfJAHjU (ORCPT + 99 others); Tue, 1 Oct 2019 03:39:20 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:56008 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbfJAHjU (ORCPT ); Tue, 1 Oct 2019 03:39:20 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.92.2) (envelope-from ) id 1iFCkW-00013w-NK; Tue, 01 Oct 2019 09:39:08 +0200 Message-ID: <1b17084d8649bab347b952231d9312b7fb7307f4.camel@sipsolutions.net> Subject: Re: [PATCH net v4 00/12] net: fix nested device bugs From: Johannes Berg To: Taehee Yoo Cc: David Miller , Netdev , linux-wireless@vger.kernel.org, Jakub Kicinski , j.vosburgh@gmail.com, vfalico@gmail.com, Andy Gospodarek , =?UTF-8?Q?Ji=C5=99=C3=AD_P=C3=ADrko?= , sd@queasysnail.net, Roopa Prabhu , saeedm@mellanox.com, manishc@marvell.com, rahulv@marvell.com, kys@microsoft.com, haiyangz@microsoft.com, Stephen Hemminger , sashal@kernel.org, hare@suse.de, varun@chelsio.com, ubraun@linux.ibm.com, kgraul@linux.ibm.com, Jay Vosburgh , Cody Schuffelen , bjorn@mork.no Date: Tue, 01 Oct 2019 09:39:07 +0200 In-Reply-To: (sfid-20190929_103128_233294_188E5AB3) References: <20190928164843.31800-1-ap420073@gmail.com> <2e836018c7ea299037d732e5138ca395bd1ae50f.camel@sipsolutions.net> (sfid-20190929_103128_233294_188E5AB3) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sun, 2019-09-29 at 17:31 +0900, Taehee Yoo wrote: > virt_wifi case is a little bit different case. Well, arguably, it was also just missing this - it just looks different :) > I add the last patch that is to fix refcnt leaks in the virt_wifi module. > The way to fix this is to add notifier routine. > The notifier routine could delete lower device before deleting > virt_wifi device. > If virt_wifi devices are nested, notifier would work recursively. > At that time, it would make stack memory overflow. > > Actually, before this patch, virt_wifi doesn't have the same problem. > So, I will update a comment in a v5 patch. OK, sure. > Many other devices use this way to avoid wrong nesting configuration. > And I think it's a good way. > But we should think about the below configuration. > > vlan5 > | > virt_wifi4 > | > vlan3 > | > virt_wifi2 > | > vlan1 > | > dummy0 > > That code wouldn't avoid this configuration. > And all devices couldn't avoid this config. Good point, so then really that isn't useful to check - most people won't try to set it up that way (since it's completely useless) and if they do anyway too much nesting would be caught by your patchset here. > I have been considering this case, but I couldn't make a decision yet. > Maybe common netdev function is needed to find the same device type > in their graph. I don't think it's worthwhile just to prevent somebody from making a configuration that we think now is nonsense. Perhaps they do have some kind of useful use-case for it ... > This is a little bit different question for you. > I found another bug in virt_wifi after my last patch. > Please test below commands > ip link add dummy0 type dummy > ip link add vw1 link dummy0 type virt_wifi > ip link add vw2 link vw1 type virt_wifi > modprobe -rv virt_wifi > > Then, you can see the warning messages. > If SET_NETDEV_DEV() is deleted in the virt_wifi_newlink(), > you can avoid that warning message. > But I'm not sure about it's safe to remove that. > I would really appreciate it if you let me know about that. Hmm, I don't see any warnings. SET_NETDEV_DEV() should be there though. Do you see the same if you stack it with something else inbetween? If not, I guess preventing virt_wifi from stacking on top of itself would be sufficient ... johannes