netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Taehee Yoo <ap420073@gmail.com>,
	davem@davemloft.net, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, jakub.kicinski@netronome.com,
	johannes@sipsolutions.net, j.vosburgh@gmail.com,
	vfalico@gmail.com, andy@greyhouse.net, jiri@resnulli.us,
	sd@queasysnail.net, roopa@cumulusnetworks.com,
	saeedm@mellanox.com, manishc@marvell.com, rahulv@marvell.com,
	kys@microsoft.com, haiyangz@microsoft.com,
	stephen@networkplumber.org, sashal@kernel.org, hare@suse.de,
	varun@chelsio.com, ubraun@linux.ibm.com, kgraul@linux.ibm.com,
	jay.vosburgh@canonical.com, schuffelen@google.com, bjorn@mork.no
Subject: Re: [PATCH net v5 01/10] net: core: limit nested device depth
Date: Mon, 21 Oct 2019 18:51:11 -0600	[thread overview]
Message-ID: <c0e17051-ab18-ac60-9c00-348cce84d12f@gmail.com> (raw)
In-Reply-To: <20191021184759.13125-1-ap420073@gmail.com>

On 10/21/19 12:47 PM, Taehee Yoo wrote:
> Current code doesn't limit the number of nested devices.
> Nested devices would be handled recursively and this needs huge stack
> memory. So, unlimited nested devices could make stack overflow.
> 
> This patch adds upper_level and lower_level, they are common variables
> and represent maximum lower/upper depth.
> When upper/lower device is attached or dettached,
> {lower/upper}_level are updated. and if maximum depth is bigger than 8,
> attach routine fails and returns -EMLINK.
> 
> In addition, this patch converts recursive routine of
> netdev_walk_all_{lower/upper} to iterator routine.

They were made recursive because of a particular setup. Did you verify
your changes did not break it? See commits starting with
5bb61cb5fd115bed1814f6b97417e0f397da3c79

> 
> Test commands:
>     ip link add dummy0 type dummy
>     ip link add link dummy0 name vlan1 type vlan id 1
>     ip link set vlan1 up
> 
>     for i in {2..55}
>     do
> 	    let A=$i-1
> 
> 	    ip link add vlan$i link vlan$A type vlan id $i
>     done
>     ip link del dummy0

8 levels of nested vlan seems like complete nonsense. Why not just limit
that stacking and not mess with the rest which can affect real use cases?

  parent reply	other threads:[~2019-10-22  0:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 18:47 [PATCH net v5 01/10] net: core: limit nested device depth Taehee Yoo
2019-10-21 18:47 ` [PATCH net v5 02/10] net: core: add generic lockdep keys Taehee Yoo
2019-10-21 18:47 ` [PATCH net v5 03/10] bonding: fix unexpected IFF_BONDING bit unset Taehee Yoo
2019-10-21 18:47 ` [PATCH net v5 04/10] bonding: use dynamic lockdep key instead of subclass Taehee Yoo
2019-10-21 18:47 ` [PATCH net v5 05/10] team: fix nested locking lockdep warning Taehee Yoo
2019-10-21 18:47 ` [PATCH net v5 06/10] macsec: fix refcnt leak in module exit routine Taehee Yoo
2019-10-21 18:47 ` [PATCH net v5 07/10] net: core: add ignore flag to netdev_adjacent structure Taehee Yoo
2019-10-21 18:47 ` [PATCH net v5 08/10] vxlan: add adjacent link to limit depth level Taehee Yoo
2019-10-21 18:47 ` [PATCH net v5 09/10] net: remove unnecessary variables and callback Taehee Yoo
2019-10-21 18:47 ` [PATCH net v5 10/10] virt_wifi: fix refcnt leak in module exit routine Taehee Yoo
2019-10-22  0:51 ` David Ahern [this message]
2019-10-22 16:40   ` [PATCH net v5 01/10] net: core: limit nested device depth Taehee Yoo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0e17051-ab18-ac60-9c00-348cce84d12f@gmail.com \
    --to=dsahern@gmail.com \
    --cc=andy@greyhouse.net \
    --cc=ap420073@gmail.com \
    --cc=bjorn@mork.no \
    --cc=davem@davemloft.net \
    --cc=haiyangz@microsoft.com \
    --cc=hare@suse.de \
    --cc=j.vosburgh@gmail.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=jay.vosburgh@canonical.com \
    --cc=jiri@resnulli.us \
    --cc=johannes@sipsolutions.net \
    --cc=kgraul@linux.ibm.com \
    --cc=kys@microsoft.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=rahulv@marvell.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=saeedm@mellanox.com \
    --cc=sashal@kernel.org \
    --cc=schuffelen@google.com \
    --cc=sd@queasysnail.net \
    --cc=stephen@networkplumber.org \
    --cc=ubraun@linux.ibm.com \
    --cc=varun@chelsio.com \
    --cc=vfalico@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).