<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/bridge/br_input.c, branch linux-4.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-09-01T23:35:30Z</updated>
<entry>
<title>net: bridge: don't increment tx_dropped in br_do_proxy_arp</title>
<updated>2016-09-01T23:35:30Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2016-08-30T15:44:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=85a3d4a9356b595d5440c3f1bf07ee7cecca1567'/>
<id>urn:sha1:85a3d4a9356b595d5440c3f1bf07ee7cecca1567</id>
<content type='text'>
pskb_may_pull may fail due to various reasons (e.g. alloc failure), but the
skb isn't changed/dropped and processing continues so we shouldn't
increment tx_dropped.

CC: Kyeyoon Park &lt;kyeyoonp@codeaurora.org&gt;
CC: Roopa Prabhu &lt;roopa@cumulusnetworks.com&gt;
CC: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
CC: bridge@lists.linux-foundation.org
Fixes: 958501163ddd ("bridge: Add support for IEEE 802.11 Proxy ARP")
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: Fix incorrect re-injection of LLDP packets</title>
<updated>2016-07-25T17:53:34Z</updated>
<author>
<name>Ido Schimmel</name>
</author>
<published>2016-07-22T11:56:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=baedbe55884c003819f5c8c063ec3d2569414296'/>
<id>urn:sha1:baedbe55884c003819f5c8c063ec3d2569414296</id>
<content type='text'>
Commit 8626c56c8279 ("bridge: fix potential use-after-free when hook
returns QUEUE or STOLEN verdict") caused LLDP packets arriving through a
bridge port to be re-injected to the Rx path with skb-&gt;dev set to the
bridge device, but this breaks the lldpad daemon.

The lldpad daemon opens a packet socket with protocol set to ETH_P_LLDP
for any valid device on the system, which doesn't not include soft
devices such as bridge and VLAN.

Since packet sockets (ptype_base) are processed in the Rx path after the
Rx handler, LLDP packets with skb-&gt;dev set to the bridge device never
reach the lldpad daemon.

Fix this by making the bridge's Rx handler re-inject LLDP packets with
RX_HANDLER_PASS, which effectively restores the behaviour prior to the
mentioned commit.

This means netfilter will never receive LLDP packets coming through a
bridge port, as I don't see a way in which we can have okfn() consume
the packet without breaking existing behaviour. I've already carried out
a similar fix for STP packets in commit 56fae404fb2c ("bridge: Fix
incorrect re-injection of STP packets").

Fixes: 8626c56c8279 ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
Signed-off-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Cc: Florian Westphal &lt;fw@strlen.de&gt;
Cc: John Fastabend &lt;john.fastabend@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: bridge: remove _deliver functions and consolidate forward code</title>
<updated>2016-07-17T02:57:38Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2016-07-14T03:10:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=37b090e6be2dc98ccb55bb663931546282abf2e8'/>
<id>urn:sha1:37b090e6be2dc98ccb55bb663931546282abf2e8</id>
<content type='text'>
Before this patch we had two flavors of most forwarding functions -
_forward and _deliver, the difference being that the latter are used
when the packets are locally originated. Instead of all this function
pointer passing and code duplication, we can just pass a boolean noting
that the packet was locally originated and use that to perform the
necessary checks in __br_forward. This gives a minor performance
improvement but more importantly consolidates the forwarding paths.
Also add a kernel doc comment to explain the exported br_forward()'s
arguments.

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>net: bridge: drop skb2/skb0 variables and use a local_rcv boolean</title>
<updated>2016-07-17T02:57:38Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2016-07-14T03:10:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b35c5f632b630183396a2ea2e2247ff8bbf2c94f'/>
<id>urn:sha1:b35c5f632b630183396a2ea2e2247ff8bbf2c94f</id>
<content type='text'>
Currently if the packet is going to be received locally we set skb0 or
sometimes called skb2 variables to the original skb. This can get
confusing and also we can avoid one conditional on the fast path by
simply using a boolean and passing it around. Thanks to Roopa for the
name suggestion.

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>net: bridge: rearrange flood vs unicast receive paths</title>
<updated>2016-07-17T02:57:37Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2016-07-14T03:10:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e151aab9b5b3fae96b0fcd6cbe3a7f952d6cb8f8'/>
<id>urn:sha1:e151aab9b5b3fae96b0fcd6cbe3a7f952d6cb8f8</id>
<content type='text'>
This patch removes one conditional from the unicast path by using the fact
that skb is NULL only when the packet is multicast or is local.

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>net: bridge: minor style adjustments in br_handle_frame_finish</title>
<updated>2016-07-17T02:57:37Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2016-07-14T03:09:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=46c0772d85306f2edec03c8fa40a6efa6af915bc'/>
<id>urn:sha1:46c0772d85306f2edec03c8fa40a6efa6af915bc</id>
<content type='text'>
Trivial style changes in br_handle_frame_finish.

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>net: bridge: extend MLD/IGMP query stats</title>
<updated>2016-07-09T21:40:09Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2016-07-06T19:12:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a65056ecf4b48be0d0284a7b6a57b6dace10b843'/>
<id>urn:sha1:a65056ecf4b48be0d0284a7b6a57b6dace10b843</id>
<content type='text'>
As was suggested this patch adds support for the different versions of MLD
and IGMP query types. Since the user visible structure is still in net-next
we can augment it instead of adding netlink attributes.
The distinction between the different IGMP/MLD query types is done as
suggested in Section 7.1, RFC 3376 [1] and Section 8.1, RFC 3810 [2] based
on query payload size and code for IGMP. Since all IGMP packets go through
multicast_rcv() and it uses ip_mc_check_igmp/ipv6_mc_check_mld we can be
sure that at least the ip/ipv6 header can be directly used.

[1] https://tools.ietf.org/html/rfc3376#section-7
[2] https://tools.ietf.org/html/rfc3810#section-8.1

Suggested-by: Linus Lüssing &lt;linus.luessing@c0d3.blue&gt;
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Acked-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: bridge: add support for IGMP/MLD stats and export them via netlink</title>
<updated>2016-06-30T10:18:24Z</updated>
<author>
<name>Nikolay Aleksandrov</name>
</author>
<published>2016-06-28T14:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1080ab95e3c7bdd77870e209aff83c763fdcf439'/>
<id>urn:sha1:1080ab95e3c7bdd77870e209aff83c763fdcf439</id>
<content type='text'>
This patch adds stats support for the currently used IGMP/MLD types by the
bridge. The stats are per-port (plus one stat per-bridge) and per-direction
(RX/TX). The stats are exported via netlink via the new linkxstats API
(RTM_GETSTATS). In order to minimize the performance impact, a new option
is used to enable/disable the stats - multicast_stats_enabled, similar to
the recent vlan stats. Also in order to avoid multiple IGMP/MLD type
lookups and checks, we make use of the current "igmp" member of the bridge
private skb-&gt;cb region to record the type on Rx (both host-generated and
external packets pass by multicast_rcv()). We can do that since the igmp
member was used as a boolean and all the valid IGMP/MLD types are positive
values. The normal bridge fast-path is not affected at all, the only
affected paths are the flooding ones and since we make use of the IGMP/MLD
type, we can quickly determine if the packet should be counted using
cache-hot data (cb's igmp member). We add counters for:
* IGMP Queries
* IGMP Leaves
* IGMP v1/v2/v3 reports

* MLD Queries
* MLD Leaves
* MLD v1/v2 reports

These are invaluable when monitoring or debugging complex multicast setups
with bridges.

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: Fix incorrect re-injection of STP packets</title>
<updated>2016-06-11T05:41:58Z</updated>
<author>
<name>Ido Schimmel</name>
</author>
<published>2016-06-07T09:06:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56fae404fb2c306db0a35dad0d16fa24c65678f3'/>
<id>urn:sha1:56fae404fb2c306db0a35dad0d16fa24c65678f3</id>
<content type='text'>
Commit 8626c56c8279 ("bridge: fix potential use-after-free when hook
returns QUEUE or STOLEN verdict") fixed incorrect usage of NF_HOOK's
return value by consuming packets in okfn via br_pass_frame_up().

However, this function re-injects packets to the Rx path with skb-&gt;dev
set to the bridge device, which breaks kernel's STP, as all STP packets
appear to originate from the bridge device itself.

Instead, if STP is enabled and bridge isn't a 802.1ad bridge, then learn
packet's SMAC and inject it back to the Rx path for further processing
by the packet handlers.

The patch also makes netfilter's behavior consistent with regards to
packets destined to the Bridge Group Address, as no hook registered at
LOCAL_IN will ever be called, regardless if STP is enabled or not.

Cc: Florian Westphal &lt;fw@strlen.de&gt;
Cc: Shmulik Ladkani &lt;shmulik.ladkani@gmail.com&gt;
Cc: Toshiaki Makita &lt;makita.toshiaki@lab.ntt.co.jp&gt;
Fixes: 8626c56c8279 ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
Signed-off-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict</title>
<updated>2016-03-14T19:46:41Z</updated>
<author>
<name>Florian Westphal</name>
</author>
<published>2016-03-12T10:14:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8626c56c8279b88b91b8df55345cdf89542d5e90'/>
<id>urn:sha1:8626c56c8279b88b91b8df55345cdf89542d5e90</id>
<content type='text'>
Zefir Kurtisi reported kernel panic with an openwrt specific patch.
However, it turns out that mainline has a similar bug waiting to happen.

Once NF_HOOK() returns the skb is in undefined state and must not be
used.   Moreover, the okfn must consume the skb to support async
processing (NF_QUEUE).

Current okfn in this spot doesn't consume it and caller assumes that
NF_HOOK return value tells us if skb was freed or not, but thats wrong.

It "works" because no in-tree user registers a NFPROTO_BRIDGE hook at
LOCAL_IN that returns STOLEN or NF_QUEUE verdicts.

Once we add NF_QUEUE support for nftables bridge this will break --
NF_QUEUE holds the skb for async processing, caller will erronoulsy
return RX_HANDLER_PASS and on reinject netfilter will access free'd skb.

Fix this by pushing skb up the stack in the okfn instead.

NB: It also seems dubious to use LOCAL_IN while bypassing PRE_ROUTING
completely in this case but this is how its been forever so it seems
preferable to not change this.

Cc: Felix Fietkau &lt;nbd@openwrt.org&gt;
Cc: Zefir Kurtisi &lt;zefir.kurtisi@neratec.com&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Tested-by: Zefir Kurtisi &lt;zefir.kurtisi@neratec.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
