Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1275344

[PATCH 3.12 50/72] bridge: superfluous skb->nfct check in br_nf_dev_queue_xmit

From Jiri Slaby <jslaby@suse.cz>
Newsgroups linux.kernel
Subject [PATCH 3.12 50/72] bridge: superfluous skb->nfct check in br_nf_dev_queue_xmit
Date 2015-11-23 14:20 +0100
Message-ID <qxZcg-2dc-61@gated-at.bofh.it> (permalink)
References <qxZcd-2dc-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Vasily Averin <vvs@parallels.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit aff09ce303f83bd370772349238482ae422a2341 upstream.

Currently bridge can silently drop ipv4 fragments.
If node have loaded nf_defrag_ipv4 module but have no nf_conntrack_ipv4,
br_nf_pre_routing defragments incoming ipv4 fragments
but nfct check in br_nf_dev_queue_xmit does not allow re-fragment combined
packet back, and therefore it is dropped in br_dev_queue_push_xmit without
incrementing of any failcounters

It seems the only way to hit the ip_fragment code in the bridge xmit
path is to have a fragment list whose reassembled fragments go over
the mtu. This only happens if nf_defrag is enabled. Thanks to
Florian Westphal for providing feedback to clarify this.

Defragmentation ipv4 is required not only in conntracks but at least in
TPROXY target and socket match, therefore #ifdef is changed from
NF_CONNTRACK_IPV4 to NF_DEFRAG_IPV4

Signed-off-by: Vasily Averin <vvs@openvz.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/bridge/br_netfilter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index f87736270eaa..bc9dc3877b1f 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -853,12 +853,12 @@ static unsigned int br_nf_forward_arp(unsigned int hook, struct sk_buff *skb,
 	return NF_STOLEN;
 }
 
-#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV4)
+#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV4)
 static int br_nf_dev_queue_xmit(struct sk_buff *skb)
 {
 	int ret;
 
-	if (skb->nfct != NULL && skb->protocol == htons(ETH_P_IP) &&
+	if (skb->protocol == htons(ETH_P_IP) &&
 	    skb->len + nf_bridge_mtu_reduction(skb) > skb->dev->mtu &&
 	    !skb_is_gso(skb)) {
 		if (br_parse_ip_options(skb))
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3.12 00/72] 3.12.51-stable review Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:10 +0100
  [PATCH 3.12 48/72] netfilter: xt_NFQUEUE: fix --queue-bypass regression Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 64/72] KEYS: Fix crash when attempt to garbage collect an uninstantiated keyring Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 63/72] KEYS: Fix race between key destruction and finding a keyring by name Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 55/72] net: sun4i-emac: fix memory leak on bad packet Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 54/72] ceph: fix kick_requests() Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 50/72] bridge: superfluous skb->nfct check in br_nf_dev_queue_xmit Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 56/72] macmace: add missing platform_set_drvdata() in mace_probe() Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 52/72] ceph: make sure request isn't in any waiting list when kicking request. Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 58/72] r8169: disable L23 Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 66/72] KVM: x86: work around infinite loop in microcode when #AC is delivered Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 57/72] r8169: fix the incorrect tx descriptor version Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 51/72] net:socket: set msg_namelen to 0 if msg_name is passed as NULL in msghdr struct from userland. Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
    [PATCH 3.12 71/72] x86/mm/hotplug: Pass sync_global_pgds() a correct argument in remove_pagetable() Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:20 +0100
  [PATCH 3.12 10/72] power: bq24190_charger: suppress build warning Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 15/72] dm btree: fix leak of bufio-backed block in btree_split_beneath error path Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 35/72] irda: precedence bug in irlmp_seq_hb_idx() Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 22/72] md/raid10: submit_bio_wait() returns 0 on success Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 37/72] ppp: fix pppoe_dev deletion condition in pppoe_release() Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 20/72] crypto: api - Only abort operations on fatal signal Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 27/72] mfd: wm5110: Add register patch for rev D chip Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 21/72] md/raid1: submit_bio_wait() returns 0 on success Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 25/72] serial: 8250_pci: Add support for 16 port Exar boards Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
      Re: [PATCH 3.12 25/72] serial: 8250_pci: Add support for 16 port Exar  boards Soeren Grunewald <soeren.grunewald@desy.de> - 2015-11-23 15:30 +0100
    [PATCH 3.12 32/72] libahci: Allow drivers to override start_engine Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 24/72] IB/cm: Fix rb-tree duplicate free and use-after-free Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 30/72] audit: correctly record file names with different path name types Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 26/72] serial: 8250_pci: Add support for 12 port Exar boards Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 12/72] drm/nouveau/gem: return only valid domain when there's only one Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 39/72] net/mlx4: Copy/set only sizeof struct mlx4_eqe bytes Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 28/72] mfd: wm5110: Add register patch for rev E and above Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 16/72] xhci: handle no ping response error properly Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 18/72] xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing) Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 19/72] module: Fix locking in symbol_put_addr() Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 11/72] spi: fix pointer-integer size mismatch warning Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 31/72] audit: create private file name copies when auditing inodes Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 17/72] xhci: Add spurious wakeup quirk for LynxPoint-LP controllers Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 23/72] mvsas: Fix NULL pointer dereference in mvs_slot_task_free Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
    [PATCH 3.12 34/72] Fix regression in NFSRDMA server Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
      Re: [PATCH 3.12 34/72] Fix regression in NFSRDMA server Tom Tucker <tom@opengridcomputing.com> - 2015-11-23 16:40 +0100
  Re: [PATCH 3.12 00/72] 3.12.51-stable review Guenter Roeck <linux@roeck-us.net> - 2015-11-23 17:30 +0100
  Re: [PATCH 3.12 00/72] 3.12.51-stable review Guenter Roeck <linux@roeck-us.net> - 2015-11-23 17:30 +0100
  Re: [PATCH 3.12 00/72] 3.12.51-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2015-11-23 17:40 +0100
  Re: [PATCH 3.12 00/72] 3.12.51-stable review Guenter Roeck <linux@roeck-us.net> - 2015-11-24 04:50 +0100
    Re: [PATCH 3.12 00/72] 3.12.51-stable review Jiri Slaby <jslaby@suse.cz> - 2015-11-30 10:10 +0100

csiph-web