]> git.baikalelectronics.ru Git - kernel.git/commit
bridge: Fix incorrect re-injection of LLDP packets
authorIdo Schimmel <idosch@mellanox.com>
Fri, 22 Jul 2016 11:56:20 +0000 (14:56 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jul 2016 17:53:34 +0000 (10:53 -0700)
commit9131f231272de16687099f1db7b21d59ef3d4119
tree0778408bcb11dd58c0cfd6588a9da2b6bc0d8bc8
parentb2fe6a55028ddf00b22687f18077e8e89d919522
bridge: Fix incorrect re-injection of LLDP packets

Commit 5f7bf977db3c ("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->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->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 87ac9ac2e9f5 ("bridge: Fix
incorrect re-injection of STP packets").

Fixes: 5f7bf977db3c ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Cc: Florian Westphal <fw@strlen.de>
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_input.c