netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <hcoin@quietfountain.com>
Cc: <kuniyu@amazon.com>, <netdev@vger.kernel.org>
Subject: Re: llc needs namespace awareness asap, was Re: Patch fixing STP if bridge in non-default namespace.
Date: Tue, 11 Jul 2023 11:32:06 -0700	[thread overview]
Message-ID: <20230711183206.54744-1-kuniyu@amazon.com> (raw)
In-Reply-To: <f01739c8-8f59-97d6-4edc-f2e88885bb73@quietfountain.com>

From: Harry Coin <hcoin@quietfountain.com>
Date: Tue, 11 Jul 2023 12:08:15 -0500
> On 7/10/23 22:22, Kuniyuki Iwashima wrote:
> > From: Harry Coin <hcoin@quietfountain.com>
> > Date: Mon, 10 Jul 2023 08:35:08 -0500
> >> Notice without access to link-level multicast address 01:80:C2:00:00:00,
> >> the STP loop-avoidance feature of bridges fails silently, leading to
> >> packet storms if loops exist in the related L2.  The Linux kernel's
> >> latest code silently drops BPDU STP packets if the bridge is in a
> >> non-default namespace.
> >>
> >> The current llc_rcv.c around line 166 in net/llc/llc_input.c  has
> >>
> >>          if (!net_eq(dev_net(dev), &init_net))
> >>                  goto drop;
> >>
> >> Which, when commented out, fixes this bug.  A search on &init_net may
> >> reveal many similar artifacts left over from the early days of namespace
> >> implementation.
> > I think just removing the part is not sufficient and will introduce a bug
> > in another place.
> >
> > As you found, llc has the same test in another place.  For example, when
> > you create an AF_LLC socket, it has to be in the root netns.  But if you
> > remove the test in llc_rcv() only, it seems llc_recv() would put a skb for
> > a child netns into sk's recv queue that is in the default netns.
> >
> >    - llc_rcv
> >      - if (net_eq(dev_net(dev), &init_net))
> >        - goto drop
> >      - sap_handler / llc_sap_handler
> >        - sk = llc_lookup_dgram
> >        - llc_sap_rcv
> >          - llc_sap_state_process
> > 	  - sock_queue_rcv_skb
> >
> > So, we need to namespacify the whole llc infra.
> 
> Agreed.  Probably sooner rather than later since IP4 and IP6 multicast, 
> GARP and more as well as STP depends on llc multicast delivery.   I 
> suspect the authors who added the 'drop unless default namespace' code 
> commented out above knew this, and were just buying some time.  Well, 
> the time has come.
> 
> Now all bridges in a namespace will always -- and silently -- think of 
> itself as the 'root bridge' as it can't get packets informing it 
> otherwise.  This leads to packet storms at line-level speeds bringing 
> whole infrastructures down in a self-inflicted event worse than a DDOS 
> attack.
> 
> I think whoever does 'advisories' ought to warn the community that ipv6 
> ndp (if using multicast), ipv4 arp (if using multicast), bridges with 
> STP, lldp, GARP, ipv6 multicast and ipv4 mulitcast for sockets in the 
> non-default namespace will not get RX traffic as it gets dropped in the 
> kernel before other modules or user code has a chance to see it.  
> Outcomes range from local seeming disconnection to kernel induced 
> site-crippling packet storms.
> 
> Is there a way to track this llc namespace awareness effort?  I'm new to 
> this particular dev community.  It's on a critical path for my project.

AFAIK, there is no ongoing work for this.  I can spend some cycles on
this, but note that the patches might not be backported to stable as
it would be invasive.

  reply	other threads:[~2023-07-11 18:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10 13:35 Patch fixing STP if bridge in non-default namespace Harry Coin
2023-07-11  3:22 ` Kuniyuki Iwashima
2023-07-11 17:08   ` llc needs namespace awareness asap, was " Harry Coin
2023-07-11 18:32     ` Kuniyuki Iwashima [this message]
2023-07-11 20:22       ` Harry Coin
2023-07-11 20:44         ` Andrew Lunn
2023-07-11 21:40           ` Harry Coin
2023-07-11 21:51             ` Kuniyuki Iwashima
2023-07-11 22:44               ` Harry Coin
2023-07-11 22:56                 ` Kuniyuki Iwashima
     [not found]               ` <b01e5af6-e397-486d-3428-6fa30a919042@quietfountain.com>
2023-07-12  0:55                 ` Andrew Lunn
2023-07-12  3:06                   ` Harry Coin
2023-07-13 22:37                     ` Stephen Hemminger
2023-07-12  9:44               ` Petr Machata
2023-07-12  0:49           ` Jakub Kicinski
  -- strict thread matches above, loose matches on Subject: below --
2023-08-02  3:45 Hasenbosch, Samuel J
2023-08-02  3:50 ` Kuniyuki Iwashima

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=20230711183206.54744-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=hcoin@quietfountain.com \
    --cc=netdev@vger.kernel.org \
    /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).