<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/bridge/br_private.h, branch linux-5.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-08-09T15:51:44Z</updated>
<entry>
<title>net: bridge: move default pvid init/deinit to NETDEV_REGISTER/UNREGISTER</title>
<updated>2019-08-09T15:51:44Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2019-08-02T10:57:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=34491ab5ddb9f2f490d59735858ac11a341f1e13'/>
<id>urn:sha1:34491ab5ddb9f2f490d59735858ac11a341f1e13</id>
<content type='text'>
[ Upstream commit 091adf9ba6cdb432cbcc217b47e4ffb8aa0d8865 ]

Most of the bridge device's vlan init bugs come from the fact that its
default pvid is created at the wrong time, way too early in ndo_init()
before the device is even assigned an ifindex. It introduces a bug when the
bridge's dev_addr is added as fdb during the initial default pvid creation
the notification has ifindex/NDA_MASTER both equal to 0 (see example below)
which really makes no sense for user-space[0] and is wrong.
Usually user-space software would ignore such entries, but they are
actually valid and will eventually have all necessary attributes.
It makes much more sense to send a notification *after* the device has
registered and has a proper ifindex allocated rather than before when
there's a chance that the registration might still fail or to receive
it with ifindex/NDA_MASTER == 0. Note that we can remove the fdb flush
from br_vlan_flush() since that case can no longer happen. At
NETDEV_REGISTER br-&gt;default_pvid is always == 1 as it's initialized by
br_vlan_init() before that and at NETDEV_UNREGISTER it can be anything
depending why it was called (if called due to NETDEV_REGISTER error
it'll still be == 1, otherwise it could be any value changed during the
device life time).

For the demonstration below a small change to iproute2 for printing all fdb
notifications is added, because it contained a workaround not to show
entries with ifindex == 0.
Command executed while monitoring: $ ip l add br0 type bridge
Before (both ifindex and master == 0):
$ bridge monitor fdb
36:7e:8a:b3:56:ba dev * vlan 1 master * permanent

After (proper br0 ifindex):
$ bridge monitor fdb
e6:2a:ae:7a:b7:48 dev br0 vlan 1 master br0 permanent

v4: move only the default pvid init/deinit to NETDEV_REGISTER/UNREGISTER
v3: send the correct v2 patch with all changes (stub should return 0)
v2: on error in br_vlan_init set br-&gt;vlgrp to NULL and return 0 in
    the br_vlan_bridge_event stub when bridge vlans are disabled

[0] https://bugzilla.kernel.org/show_bug.cgi?id=204389

Reported-by: michael-dev &lt;michael-dev@fami-braun.de&gt;
Fixes: 5be5a2df40f0 ("bridge: Add filtering support for default_pvid")
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Acked-by: Roopa Prabhu &lt;roopa@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152</title>
<updated>2019-05-30T18:26:32Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2019-05-27T06:55:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2874c5fd284268364ece81a7bd936f3c8168e567'/>
<id>urn:sha1:2874c5fd284268364ece81a7bd936f3c8168e567</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bridge: support binding vlan dev link state to vlan member bridge ports</title>
<updated>2019-04-19T20:58:17Z</updated>
<author>
<name>Mike Manning</name>
</author>
<published>2019-04-18T17:35:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9c0ec2e7182a508335364c752da0883a2a7f3999'/>
<id>urn:sha1:9c0ec2e7182a508335364c752da0883a2a7f3999</id>
<content type='text'>
In the case of vlan filtering on bridges, the bridge may also have the
corresponding vlan devices as upper devices. A vlan bridge binding mode
is added to allow the link state of the vlan device to track only the
state of the subset of bridge ports that are also members of the vlan,
rather than that of all bridge ports. This mode is set with a vlan flag
rather than a bridge sysfs so that the 8021q module is aware that it
should not set the link state for the vlan device.

If bridge vlan is configured, the bridge device event handling results
in the link state for an upper device being set, if it is a vlan device
with the vlan bridge binding mode enabled. This also sets a
vlan_bridge_binding flag so that subsequent UP/DOWN/CHANGE events for
the ports in that bridge result in a link state update of the vlan
device if required.

The link state of the vlan device is up if there is at least one bridge
port that is a vlan member that is admin &amp; oper up, otherwise its oper
state is IF_OPER_LOWERLAYERDOWN.

Signed-off-by: Mike Manning &lt;mmanning@vyatta.att-mail.com&gt;
Acked-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: broute: make broute a real ebtables table</title>
<updated>2019-04-11T23:47:50Z</updated>
<author>
<name>Florian Westphal</name>
</author>
<published>2019-04-11T14:36:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=223fd0adfa8af36d5d9b5d38016e579ee052f367'/>
<id>urn:sha1:223fd0adfa8af36d5d9b5d38016e579ee052f367</id>
<content type='text'>
This makes broute a normal ebtables table, hooking at PREROUTING.
The broute hook is removed.

It uses skb-&gt;cb to signal to bridge rx handler that the skb should be
routed instead of being bridged.

This change is backwards compatible with ebtables as no userspace visible
parts are changed.

This means we can also remove the !ops test in ebt_register_table,
it was only there for broute table sake.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>bridge: reduce size of input cb to 16 bytes</title>
<updated>2019-04-11T23:47:27Z</updated>
<author>
<name>Florian Westphal</name>
</author>
<published>2019-04-11T14:36:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f12064d1b402c60c5db9c4b63d5ed6d7facb33f6'/>
<id>urn:sha1:f12064d1b402c60c5db9c4b63d5ed6d7facb33f6</id>
<content type='text'>
Reduce size of br_input_skb_cb from 24 to 16 bytes by
using bitfield for those values that can only be 0 or 1.

igmp is the igmp type value, so it needs to be at least u8.

Furthermore, the bridge currently relies on step-by-step initialization
of br_input_skb_cb fields as the skb passes through the stack.

Explicitly zero out the bridge input cb instead, this avoids having to
review/validate that no BR_INPUT_SKB_CB(skb)-&gt;foo test can see a
'random' value from previous protocol cb.

AFAICS all current fields are always set up before they are read again,
so this is not a bug fix.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>net: bridge: use netif_is_bridge_port()</title>
<updated>2019-03-29T20:48:40Z</updated>
<author>
<name>Julian Wiedmann</name>
</author>
<published>2019-03-29T13:38:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=35f861e3c58e128f0ecb5669c43159285ea5254a'/>
<id>urn:sha1:35f861e3c58e128f0ecb5669c43159285ea5254a</id>
<content type='text'>
Replace the br_port_exists() macro with its twin from netdevice.h

CC: Roopa Prabhu &lt;roopa@cumulusnetworks.com&gt;
CC: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: Julian Wiedmann &lt;jwi@linux.ibm.com&gt;
Acked-by: Roopa Prabhu &lt;roopa@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Add extack argument to ndo_fdb_add()</title>
<updated>2019-01-17T23:18:47Z</updated>
<author>
<name>Petr Machata</name>
</author>
<published>2019-01-16T23:06:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=87b0984ebfabafcfe959e52ca5cdab5eeb2d60c0'/>
<id>urn:sha1:87b0984ebfabafcfe959e52ca5cdab5eeb2d60c0</id>
<content type='text'>
Drivers may not be able to support certain FDB entries, and an error
code is insufficient to give clear hints as to the reasons of rejection.

In order to make it possible to communicate the rejection reason, extend
ndo_fdb_add() with an extack argument. Adapt the existing
implementations of ndo_fdb_add() to take the parameter (and ignore it).
Pass the extack parameter when invoking ndo_fdb_add() from rtnl_fdb_add().

Signed-off-by: Petr Machata &lt;petrm@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: bridge: Fix VLANs memory leak</title>
<updated>2019-01-08T21:53:54Z</updated>
<author>
<name>Ido Schimmel</name>
</author>
<published>2019-01-08T16:48:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=279737939a8194f02fa352ab4476a1b241f44ef4'/>
<id>urn:sha1:279737939a8194f02fa352ab4476a1b241f44ef4</id>
<content type='text'>
When adding / deleting VLANs to / from a bridge port, the bridge driver
first tries to propagate the information via switchdev and falls back to
the 8021q driver in case the underlying driver does not support
switchdev. This can result in a memory leak [1] when VXLAN and mlxsw
ports are enslaved to the bridge:

$ ip link set dev vxlan0 master br0
# No mlxsw ports are enslaved to 'br0', so mlxsw ignores the switchdev
# notification and the bridge driver adds the VLAN on 'vxlan0' via the
# 8021q driver
$ bridge vlan add vid 10 dev vxlan0 pvid untagged
# mlxsw port is enslaved to the bridge
$ ip link set dev swp1 master br0
# mlxsw processes the switchdev notification and the 8021q driver is
# skipped
$ bridge vlan del vid 10 dev vxlan0

This results in 'struct vlan_info' and 'struct vlan_vid_info' being
leaked, as they were allocated by the 8021q driver during VLAN addition,
but never freed as the 8021q driver was skipped during deletion.

Fix this by introducing a new VLAN private flag that indicates whether
the VLAN was added on the port by switchdev or the 8021q driver. If the
VLAN was added by the 8021q driver, then we make sure to delete it via
the 8021q driver as well.

[1]
unreferenced object 0xffff88822d20b1e8 (size 256):
  comm "bridge", pid 2532, jiffies 4295216998 (age 1188.830s)
  hex dump (first 32 bytes):
    e0 42 97 ce 81 88 ff ff 00 00 00 00 00 00 00 00  .B..............
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;00000000f82d851d&gt;] kmem_cache_alloc_trace+0x1be/0x330
    [&lt;00000000e0178b02&gt;] vlan_vid_add+0x661/0x920
    [&lt;00000000218ebd5f&gt;] __vlan_add+0x1be9/0x3a00
    [&lt;000000006eafa1ca&gt;] nbp_vlan_add+0x8b3/0xd90
    [&lt;000000003535392c&gt;] br_vlan_info+0x132/0x410
    [&lt;00000000aedaa9dc&gt;] br_afspec+0x75c/0x870
    [&lt;00000000f5716133&gt;] br_setlink+0x3dc/0x6d0
    [&lt;00000000aceca5e2&gt;] rtnl_bridge_setlink+0x615/0xb30
    [&lt;00000000a2f2d23e&gt;] rtnetlink_rcv_msg+0x3a3/0xa80
    [&lt;0000000064097e69&gt;] netlink_rcv_skb+0x152/0x3c0
    [&lt;000000008be8d614&gt;] rtnetlink_rcv+0x21/0x30
    [&lt;000000009ab2ca25&gt;] netlink_unicast+0x52f/0x740
    [&lt;00000000e7d9ac96&gt;] netlink_sendmsg+0x9c7/0xf50
    [&lt;000000005d1e2050&gt;] sock_sendmsg+0xbe/0x120
    [&lt;00000000d51426bc&gt;] ___sys_sendmsg+0x778/0x8f0
    [&lt;00000000b9d7b2cc&gt;] __sys_sendmsg+0x112/0x270
unreferenced object 0xffff888227454308 (size 32):
  comm "bridge", pid 2532, jiffies 4295216998 (age 1188.882s)
  hex dump (first 32 bytes):
    88 b2 20 2d 82 88 ff ff 88 b2 20 2d 82 88 ff ff  .. -...... -....
    81 00 0a 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;00000000f82d851d&gt;] kmem_cache_alloc_trace+0x1be/0x330
    [&lt;0000000018050631&gt;] vlan_vid_add+0x3e6/0x920
    [&lt;00000000218ebd5f&gt;] __vlan_add+0x1be9/0x3a00
    [&lt;000000006eafa1ca&gt;] nbp_vlan_add+0x8b3/0xd90
    [&lt;000000003535392c&gt;] br_vlan_info+0x132/0x410
    [&lt;00000000aedaa9dc&gt;] br_afspec+0x75c/0x870
    [&lt;00000000f5716133&gt;] br_setlink+0x3dc/0x6d0
    [&lt;00000000aceca5e2&gt;] rtnl_bridge_setlink+0x615/0xb30
    [&lt;00000000a2f2d23e&gt;] rtnetlink_rcv_msg+0x3a3/0xa80
    [&lt;0000000064097e69&gt;] netlink_rcv_skb+0x152/0x3c0
    [&lt;000000008be8d614&gt;] rtnetlink_rcv+0x21/0x30
    [&lt;000000009ab2ca25&gt;] netlink_unicast+0x52f/0x740
    [&lt;00000000e7d9ac96&gt;] netlink_sendmsg+0x9c7/0xf50
    [&lt;000000005d1e2050&gt;] sock_sendmsg+0xbe/0x120
    [&lt;00000000d51426bc&gt;] ___sys_sendmsg+0x778/0x8f0
    [&lt;00000000b9d7b2cc&gt;] __sys_sendmsg+0x112/0x270

Fixes: d70e42b22dd4 ("mlxsw: spectrum: Enable VxLAN enslavement to VLAN-aware bridges")
Signed-off-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Reviewed-by: Petr Machata &lt;petrm@mellanox.com&gt;
Cc: Roopa Prabhu &lt;roopa@cumulusnetworks.com&gt;
Cc: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Cc: bridge@lists.linux-foundation.org
Acked-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: support for ndo_fdb_get</title>
<updated>2018-12-16T22:42:34Z</updated>
<author>
<name>Roopa Prabhu</name>
</author>
<published>2018-12-16T06:35:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4767456212f8cd70775dc55d9bc72e184ff84642'/>
<id>urn:sha1:4767456212f8cd70775dc55d9bc72e184ff84642</id>
<content type='text'>
This patch implements ndo_fdb_get for the bridge
fdb.

Signed-off-by: Roopa Prabhu &lt;roopa@cumulusnetworks.com&gt;
Acked-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Reviewed-by: David Ahern &lt;dsa@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: bridge: Propagate extack to switchdev</title>
<updated>2018-12-13T00:34:21Z</updated>
<author>
<name>Petr Machata</name>
</author>
<published>2018-12-12T17:02:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=169327d5850cb80d98d095cfaf8dfbb63d576864'/>
<id>urn:sha1:169327d5850cb80d98d095cfaf8dfbb63d576864</id>
<content type='text'>
ndo_bridge_setlink has been updated in the previous patch to have extack
available, and changelink RTNL op has had this argument since the time
extack was added. Propagate both through the bridge driver to eventually
reach br_switchdev_port_vlan_add(), where it will be used by subsequent
patches.

Signed-off-by: Petr Machata &lt;petrm@mellanox.com&gt;
Acked-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Acked-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Acked-by: Ivan Vecera &lt;ivecera@redhat.com&gt;
Acked-by: Roopa Prabhu &lt;roopa@cumulusnetworks.com&gt;
Reviewed-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
