<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/bridge/br_input.c, branch linux-4.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-05-25T06:41:20Z</updated>
<entry>
<title>net: bridge: Clear offload_fwd_mark when passing frame up bridge interface.</title>
<updated>2022-05-25T06:41:20Z</updated>
<author>
<name>Andrew Lunn</name>
</author>
<published>2022-05-18T00:58:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f67219813f55f370a3899cd6753e1941b8b6017'/>
<id>urn:sha1:3f67219813f55f370a3899cd6753e1941b8b6017</id>
<content type='text'>
[ Upstream commit fbb3abdf2223cd0dfc07de85fe5a43ba7f435bdf ]

It is possible to stack bridges on top of each other. Consider the
following which makes use of an Ethernet switch:

       br1
     /    \
    /      \
   /        \
 br0.11    wlan0
   |
   br0
 /  |  \
p1  p2  p3

br0 is offloaded to the switch. Above br0 is a vlan interface, for
vlan 11. This vlan interface is then a slave of br1. br1 also has a
wireless interface as a slave. This setup trunks wireless lan traffic
over the copper network inside a VLAN.

A frame received on p1 which is passed up to the bridge has the
skb-&gt;offload_fwd_mark flag set to true, indicating that the switch has
dealt with forwarding the frame out ports p2 and p3 as needed. This
flag instructs the software bridge it does not need to pass the frame
back down again. However, the flag is not getting reset when the frame
is passed upwards. As a result br1 sees the flag, wrongly interprets
it, and fails to forward the frame to wlan0.

When passing a frame upwards, clear the flag. This is the Rx
equivalent of br_switchdev_frame_unmark() in br_dev_xmit().

Fixes: f1c2eddf4cb6 ("bridge: switchdev: Use an helper to clear forward mark")
Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Reviewed-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Tested-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Acked-by: Nikolay Aleksandrov &lt;razor@blackwall.org&gt;
Link: https://lore.kernel.org/r/20220518005840.771575-1-andrew@lunn.ch
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: bridge: fix per-port af_packet sockets</title>
<updated>2019-04-27T07:35:33Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2019-04-11T10:56:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1a9b69e2605db1edea34bb3a6051cf845b26bc1'/>
<id>urn:sha1:a1a9b69e2605db1edea34bb3a6051cf845b26bc1</id>
<content type='text'>
[ Upstream commit 3b2e2904deb314cc77a2192f506f2fd44e3d10d0 ]

When the commit below was introduced it changed two visible things:
 - the skb was no longer passed through the protocol handlers with the
   original device
 - the skb was passed up the stack with skb-&gt;dev = bridge

The first change broke af_packet sockets on bridge ports. For example we
use them for hostapd which listens for ETH_P_PAE packets on the ports.
We discussed two possible fixes:
 - create a clone and pass it through NF_HOOK(), act on the original skb
   based on the result
 - somehow signal to the caller from the okfn() that it was called,
   meaning the skb is ok to be passed, which this patch is trying to
   implement via returning 1 from the bridge link-local okfn()

Note that we rely on the fact that NF_QUEUE/STOLEN would return 0 and
drop/error would return &lt; 0 thus the okfn() is called only when the
return was 1, so we signal to the caller that it was called by preserving
the return value from nf_hook().

Fixes: 8626c56c8279 ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@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>net: bridge: fix dest lookup when vlan proto doesn't match</title>
<updated>2017-07-14T15:19:23Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2017-07-13T13:09:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=31a4562d7408493c6377933ff2f7d7302dbdea80'/>
<id>urn:sha1:31a4562d7408493c6377933ff2f7d7302dbdea80</id>
<content type='text'>
With 802.1ad support the vlan_ingress code started checking for vlan
protocol mismatch which causes the current tag to be inserted and the
bridge vlan protocol &amp; pvid to be set. The vlan tag insertion changes
the skb mac_header and thus the lookup mac dest pointer which was loaded
prior to calling br_allowed_ingress in br_handle_frame_finish is VLAN_HLEN
bytes off now, pointing to the last two bytes of the destination mac and
the first four of the source mac causing lookups to always fail and
broadcasting all such packets to all ports. Same thing happens for locally
originated packets when passing via br_dev_xmit. So load the dest pointer
after the vlan checks and possible skb change.

Fixes: 8580e2117c06 ("bridge: Prepare for 802.1ad vlan filtering support")
Reported-by: Anitha Narasimha Murthy &lt;anitha@cumulusnetworks.com&gt;
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Acked-by: Toshiaki Makita &lt;makita.toshiaki@lab.ntt.co.jp&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: drop netfilter fake rtable unconditionally</title>
<updated>2017-03-13T20:01:10Z</updated>
<author>
<name>Florian Westphal</name>
</author>
<published>2017-03-13T16:38:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a13b2082ece95247779b9995c4e91b4246bed023'/>
<id>urn:sha1:a13b2082ece95247779b9995c4e91b4246bed023</id>
<content type='text'>
Andreas reports kernel oops during rmmod of the br_netfilter module.
Hannes debugged the oops down to a NULL rt6info-&gt;rt6i_indev.

Problem is that br_netfilter has the nasty concept of adding a fake
rtable to skb-&gt;dst; this happens in a br_netfilter prerouting hook.

A second hook (in bridge LOCAL_IN) is supposed to remove these again
before the skb is handed up the stack.

However, on module unload hooks get unregistered which means an
skb could traverse the prerouting hook that attaches the fake_rtable,
while the 'fake rtable remove' hook gets removed from the hooklist
immediately after.

Fixes: 34666d467cbf1e2e3c7 ("netfilter: bridge: move br_netfilter out of the core")
Reported-by: Andreas Karis &lt;akaris@redhat.com&gt;
Debugged-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Acked-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: fdb: converge fdb searching functions into one</title>
<updated>2017-02-14T17:41:02Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2017-02-13T13:59:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bfd0aeac52f74bfb44c0974131e44abb33a13e78'/>
<id>urn:sha1:bfd0aeac52f74bfb44c0974131e44abb33a13e78</id>
<content type='text'>
Before this patch we had 3 different fdb searching functions which was
confusing. This patch reduces all of them to one - fdb_find_rcu(), and
two flavors: br_fdb_find() which requires hash_lock and br_fdb_find_rcu
which requires RCU. This makes it clear what needs to be used, we also
remove two abusers of __br_fdb_get which called it under hash_lock and
replace them with br_fdb_find().

Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: avoid unnecessary read of jiffies</title>
<updated>2017-02-07T19:16:05Z</updated>
<author>
<name>stephen hemminger</name>
</author>
<published>2017-02-07T16:46:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca6d4480f87db9d9470d3d7bbe445953fa105e57'/>
<id>urn:sha1:ca6d4480f87db9d9470d3d7bbe445953fa105e57</id>
<content type='text'>
Jiffies is volatile so read it once.

Signed-off-by: Stephen Hemminger &lt;sthemmin@microsoft.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: fdb: write to used and updated at most once per jiffy</title>
<updated>2017-02-07T03:53:13Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2017-02-04T17:05:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83a718d6294964fd1b227fa5f1ad001bc1fe7656'/>
<id>urn:sha1:83a718d6294964fd1b227fa5f1ad001bc1fe7656</id>
<content type='text'>
Writing once per jiffy is enough to limit the bridge's false sharing.
After this change the bridge doesn't show up in the local load HitM stats.

Suggested-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: vlan dst_metadata hooks in ingress and egress paths</title>
<updated>2017-02-03T20:21:22Z</updated>
<author>
<name>Roopa Prabhu</name>
</author>
<published>2017-02-01T06:59:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=11538d039ac6efcf4f1a6c536e1b87cd3668a9fd'/>
<id>urn:sha1:11538d039ac6efcf4f1a6c536e1b87cd3668a9fd</id>
<content type='text'>
- ingress hook:
    - if port is a tunnel port, use tunnel info in
      attached dst_metadata to map it to a local vlan
- egress hook:
    - if port is a tunnel port, use tunnel info attached to
      vlan to set dst_metadata on the skb

CC: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: Roopa Prabhu &lt;roopa@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2016-09-12T22:52:44Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2016-09-12T22:52:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b20b378d49926b82c0a131492fa8842156e0e8a9'/>
<id>urn:sha1:b20b378d49926b82c0a131492fa8842156e0e8a9</id>
<content type='text'>
Conflicts:
	drivers/net/ethernet/mediatek/mtk_eth_soc.c
	drivers/net/ethernet/qlogic/qed/qed_dcbx.c
	drivers/net/phy/Kconfig

All conflicts were cases of overlapping commits.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: bridge: change unicast boolean to exact pkt_type</title>
<updated>2016-09-02T05:48:33Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2016-08-31T13:36:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8addd5e7d3a5c118a214a7794ae299787198aa25'/>
<id>urn:sha1:8addd5e7d3a5c118a214a7794ae299787198aa25</id>
<content type='text'>
Remove the unicast flag and introduce an exact pkt_type. That would help us
for the upcoming per-port multicast flood flag and also slightly reduce the
tests in the input fast path.

Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
