<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/net/openvswitch/conntrack.c, branch v4.7</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>openvswitch: fix conntrack netlink event delivery</title>
<updated>2016-06-29T12:13:59+00:00</updated>
<author>
<name>Samuel Gauthier</name>
<email>samuel.gauthier@6wind.com</email>
</author>
<published>2016-06-28T15:22:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d913d3a763a6f66a862a6eafcf6da89a7905832a'/>
<id>d913d3a763a6f66a862a6eafcf6da89a7905832a</id>
<content type='text'>
Only the first and last netlink message for a particular conntrack are
actually sent. The first message is sent through nf_conntrack_confirm when
the conntrack is committed. The last one is sent when the conntrack is
destroyed on timeout. The other conntrack state change messages are not
advertised.

When the conntrack subsystem is used from netfilter, nf_conntrack_confirm
is called for each packet, from the postrouting hook, which in turn calls
nf_ct_deliver_cached_events to send the state change netlink messages.

This commit fixes the problem by calling nf_ct_deliver_cached_events in the
non-commit case as well.

Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action")
CC: Joe Stringer &lt;joestringer@nicira.com&gt;
CC: Justin Pettit &lt;jpettit@nicira.com&gt;
CC: Andy Zhou &lt;azhou@nicira.com&gt;
CC: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: Samuel Gauthier &lt;samuel.gauthier@6wind.com&gt;
Acked-by: Joe Stringer &lt;joe@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only the first and last netlink message for a particular conntrack are
actually sent. The first message is sent through nf_conntrack_confirm when
the conntrack is committed. The last one is sent when the conntrack is
destroyed on timeout. The other conntrack state change messages are not
advertised.

When the conntrack subsystem is used from netfilter, nf_conntrack_confirm
is called for each packet, from the postrouting hook, which in turn calls
nf_ct_deliver_cached_events to send the state change netlink messages.

This commit fixes the problem by calling nf_ct_deliver_cached_events in the
non-commit case as well.

Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action")
CC: Joe Stringer &lt;joestringer@nicira.com&gt;
CC: Justin Pettit &lt;jpettit@nicira.com&gt;
CC: Andy Zhou &lt;azhou@nicira.com&gt;
CC: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: Samuel Gauthier &lt;samuel.gauthier@6wind.com&gt;
Acked-by: Joe Stringer &lt;joe@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2016-05-15T17:32:48+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2016-05-15T17:32:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=909b27f706433a0b3dff79aa259de63aafe40a42'/>
<id>909b27f706433a0b3dff79aa259de63aafe40a42</id>
<content type='text'>
The nf_conntrack_core.c fix in 'net' is not relevant in 'net-next'
because we no longer have a per-netns conntrack hash.

The ip_gre.c conflict as well as the iwlwifi ones were cases of
overlapping changes.

Conflicts:
	drivers/net/wireless/intel/iwlwifi/mvm/tx.c
	net/ipv4/ip_gre.c
	net/netfilter/nf_conntrack_core.c

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The nf_conntrack_core.c fix in 'net' is not relevant in 'net-next'
because we no longer have a per-netns conntrack hash.

The ip_gre.c conflict as well as the iwlwifi ones were cases of
overlapping changes.

Conflicts:
	drivers/net/wireless/intel/iwlwifi/mvm/tx.c
	net/ipv4/ip_gre.c
	net/netfilter/nf_conntrack_core.c

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: Fix cached ct with helper.</title>
<updated>2016-05-11T19:14:56+00:00</updated>
<author>
<name>Joe Stringer</name>
<email>joe@ovn.org</email>
</author>
<published>2016-05-11T17:29:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=16ec3d4fbb967bd0e1c8d9dce9ef70e915a86615'/>
<id>16ec3d4fbb967bd0e1c8d9dce9ef70e915a86615</id>
<content type='text'>
When using conntrack helpers from OVS, a common configuration is to
perform a lookup without specifying a helper, then go through a
firewalling policy, only to decide to attach a helper afterwards.

In this case, the initial lookup will cause a ct entry to be attached to
the skb, then the later commit with helper should attach the helper and
confirm the connection. However, the helper attachment has been missing.
If the user has enabled automatic helper attachment, then this issue
will be masked as it will be applied in init_conntrack(). It is also
masked if the action is executed from ovs_packet_cmd_execute() as that
will construct a fresh skb.

This patch fixes the issue by making an explicit call to try to assign
the helper if there is a discrepancy between the action's helper and the
current skb-&gt;nfct.

Fixes: cae3a2627520 ("openvswitch: Allow attaching helpers to ct action")
Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When using conntrack helpers from OVS, a common configuration is to
perform a lookup without specifying a helper, then go through a
firewalling policy, only to decide to attach a helper afterwards.

In this case, the initial lookup will cause a ct entry to be attached to
the skb, then the later commit with helper should attach the helper and
confirm the connection. However, the helper attachment has been missing.
If the user has enabled automatic helper attachment, then this issue
will be masked as it will be applied in init_conntrack(). It is also
masked if the action is executed from ovs_packet_cmd_execute() as that
will construct a fresh skb.

This patch fixes the issue by making an explicit call to try to assign
the helper if there is a discrepancy between the action's helper and the
current skb-&gt;nfct.

Fixes: cae3a2627520 ("openvswitch: Allow attaching helpers to ct action")
Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: __nf_ct_l{3,4}proto_find() always return a valid pointer</title>
<updated>2016-05-05T14:39:50+00:00</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2016-05-03T09:13:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3b78155b1b3688dbe910fecdc3e003f431b46630'/>
<id>3b78155b1b3688dbe910fecdc3e003f431b46630</id>
<content type='text'>
If the protocol is not natively supported, this assigns generic protocol
tracker so we can always assume a valid pointer after these calls.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Acked-by: Jarno Rajahalme &lt;jrajahalme@nicira.com&gt;
Acked-by: Joe Stringer &lt;joe@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the protocol is not natively supported, this assigns generic protocol
tracker so we can always assume a valid pointer after these calls.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Acked-by: Jarno Rajahalme &lt;jrajahalme@nicira.com&gt;
Acked-by: Joe Stringer &lt;joe@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next</title>
<updated>2016-04-24T04:12:08+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2016-04-24T04:12:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=11afbff86168bc2ce11ae9d64ff687567a2352de'/>
<id>11afbff86168bc2ce11ae9d64ff687567a2352de</id>
<content type='text'>
Pablo Neira Ayuso says:

====================
Netfilter updates for net-next

The following patchset contains Netfilter updates for your net-next
tree, mostly from Florian Westphal to sort out the lack of sufficient
validation in x_tables and connlabel preparation patches to add
nf_tables support. They are:

1) Ensure we don't go over the ruleset blob boundaries in
   mark_source_chains().

2) Validate that target jumps land on an existing xt_entry. This extra
   sanitization comes with a performance penalty when loading the ruleset.

3) Introduce xt_check_entry_offsets() and use it from {arp,ip,ip6}tables.

4) Get rid of the smallish check_entry() functions in {arp,ip,ip6}tables.

5) Make sure the minimal possible target size in x_tables.

6) Similar to #3, add xt_compat_check_entry_offsets() for compat code.

7) Check that standard target size is valid.

8) More sanitization to ensure that the target_offset field is correct.

9) Add xt_check_entry_match() to validate that matches are well-formed.

10-12) Three patch to reduce the number of parameters in
    translate_compat_table() for {arp,ip,ip6}tables by using a container
    structure.

13) No need to return value from xt_compat_match_from_user(), so make
    it void.

14) Consolidate translate_table() so it can be used by compat code too.

15) Remove obsolete check for compat code, so we keep consistent with
    what was already removed in the native layout code (back in 2007).

16) Get rid of target jump validation from mark_source_chains(),
    obsoleted by #2.

17) Introduce xt_copy_counters_from_user() to consolidate counter
    copying, and use it from {arp,ip,ip6}tables.

18,22) Get rid of unnecessary explicit inlining in ctnetlink for dump
    functions.

19) Move nf_connlabel_match() to xt_connlabel.

20) Skip event notification if connlabel did not change.

21) Update of nf_connlabels_get() to make the upcoming nft connlabel
    support easier.

23) Remove spinlock to read protocol state field in conntrack.
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pablo Neira Ayuso says:

====================
Netfilter updates for net-next

The following patchset contains Netfilter updates for your net-next
tree, mostly from Florian Westphal to sort out the lack of sufficient
validation in x_tables and connlabel preparation patches to add
nf_tables support. They are:

1) Ensure we don't go over the ruleset blob boundaries in
   mark_source_chains().

2) Validate that target jumps land on an existing xt_entry. This extra
   sanitization comes with a performance penalty when loading the ruleset.

3) Introduce xt_check_entry_offsets() and use it from {arp,ip,ip6}tables.

4) Get rid of the smallish check_entry() functions in {arp,ip,ip6}tables.

5) Make sure the minimal possible target size in x_tables.

6) Similar to #3, add xt_compat_check_entry_offsets() for compat code.

7) Check that standard target size is valid.

8) More sanitization to ensure that the target_offset field is correct.

9) Add xt_check_entry_match() to validate that matches are well-formed.

10-12) Three patch to reduce the number of parameters in
    translate_compat_table() for {arp,ip,ip6}tables by using a container
    structure.

13) No need to return value from xt_compat_match_from_user(), so make
    it void.

14) Consolidate translate_table() so it can be used by compat code too.

15) Remove obsolete check for compat code, so we keep consistent with
    what was already removed in the native layout code (back in 2007).

16) Get rid of target jump validation from mark_source_chains(),
    obsoleted by #2.

17) Introduce xt_copy_counters_from_user() to consolidate counter
    copying, and use it from {arp,ip,ip6}tables.

18,22) Get rid of unnecessary explicit inlining in ctnetlink for dump
    functions.

19) Move nf_connlabel_match() to xt_connlabel.

20) Skip event notification if connlabel did not change.

21) Update of nf_connlabels_get() to make the upcoming nft connlabel
    support easier.

23) Remove spinlock to read protocol state field in conntrack.
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: Orphan skbs before IPv6 defrag</title>
<updated>2016-04-21T17:42:05+00:00</updated>
<author>
<name>Joe Stringer</name>
<email>joe@ovn.org</email>
</author>
<published>2016-04-18T21:51:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=49e261a8a21e0960a3f7ff187a453ba1c1149053'/>
<id>49e261a8a21e0960a3f7ff187a453ba1c1149053</id>
<content type='text'>
This is the IPv6 counterpart to commit 8282f27449bf ("inet: frag: Always
orphan skbs inside ip_defrag()").

Prior to commit 029f7f3b8701 ("netfilter: ipv6: nf_defrag: avoid/free
clone operations"), ipv6 fragments sent to nf_ct_frag6_gather() would be
cloned (implicitly orphaning) prior to queueing for reassembly. As such,
when the IPv6 message is eventually reassembled, the skb-&gt;sk for all
fragments would be NULL. After that commit was introduced, rather than
cloning, the original skbs were queued directly without orphaning. The
end result is that all frags except for the first and last may have a
socket attached.

This commit explicitly orphans such skbs during nf_ct_frag6_gather() to
prevent BUG_ON(skb-&gt;sk) during a later call to ip6_fragment().

kernel BUG at net/ipv6/ip6_output.c:631!
[...]
Call Trace:
 &lt;IRQ&gt;
 [&lt;ffffffff810be8f7&gt;] ? __lock_acquire+0x927/0x20a0
 [&lt;ffffffffa042c7c0&gt;] ? do_output.isra.28+0x1b0/0x1b0 [openvswitch]
 [&lt;ffffffff810bb8a2&gt;] ? __lock_is_held+0x52/0x70
 [&lt;ffffffffa042c587&gt;] ovs_fragment+0x1f7/0x280 [openvswitch]
 [&lt;ffffffff810bdab5&gt;] ? mark_held_locks+0x75/0xa0
 [&lt;ffffffff817be416&gt;] ? _raw_spin_unlock_irqrestore+0x36/0x50
 [&lt;ffffffff81697ea0&gt;] ? dst_discard_out+0x20/0x20
 [&lt;ffffffff81697e80&gt;] ? dst_ifdown+0x80/0x80
 [&lt;ffffffffa042c703&gt;] do_output.isra.28+0xf3/0x1b0 [openvswitch]
 [&lt;ffffffffa042d279&gt;] do_execute_actions+0x709/0x12c0 [openvswitch]
 [&lt;ffffffffa04340a4&gt;] ? ovs_flow_stats_update+0x74/0x1e0 [openvswitch]
 [&lt;ffffffffa04340d1&gt;] ? ovs_flow_stats_update+0xa1/0x1e0 [openvswitch]
 [&lt;ffffffff817be387&gt;] ? _raw_spin_unlock+0x27/0x40
 [&lt;ffffffffa042de75&gt;] ovs_execute_actions+0x45/0x120 [openvswitch]
 [&lt;ffffffffa0432d65&gt;] ovs_dp_process_packet+0x85/0x150 [openvswitch]
 [&lt;ffffffff817be387&gt;] ? _raw_spin_unlock+0x27/0x40
 [&lt;ffffffffa042def4&gt;] ovs_execute_actions+0xc4/0x120 [openvswitch]
 [&lt;ffffffffa0432d65&gt;] ovs_dp_process_packet+0x85/0x150 [openvswitch]
 [&lt;ffffffffa04337f2&gt;] ? key_extract+0x442/0xc10 [openvswitch]
 [&lt;ffffffffa043b26d&gt;] ovs_vport_receive+0x5d/0xb0 [openvswitch]
 [&lt;ffffffff810be8f7&gt;] ? __lock_acquire+0x927/0x20a0
 [&lt;ffffffff810be8f7&gt;] ? __lock_acquire+0x927/0x20a0
 [&lt;ffffffff810be8f7&gt;] ? __lock_acquire+0x927/0x20a0
 [&lt;ffffffff817be416&gt;] ? _raw_spin_unlock_irqrestore+0x36/0x50
 [&lt;ffffffffa043c11d&gt;] internal_dev_xmit+0x6d/0x150 [openvswitch]
 [&lt;ffffffffa043c0b5&gt;] ? internal_dev_xmit+0x5/0x150 [openvswitch]
 [&lt;ffffffff8168fb5f&gt;] dev_hard_start_xmit+0x2df/0x660
 [&lt;ffffffff8168f5ea&gt;] ? validate_xmit_skb.isra.105.part.106+0x1a/0x2b0
 [&lt;ffffffff81690925&gt;] __dev_queue_xmit+0x8f5/0x950
 [&lt;ffffffff81690080&gt;] ? __dev_queue_xmit+0x50/0x950
 [&lt;ffffffff810bdab5&gt;] ? mark_held_locks+0x75/0xa0
 [&lt;ffffffff81690990&gt;] dev_queue_xmit+0x10/0x20
 [&lt;ffffffff8169a418&gt;] neigh_resolve_output+0x178/0x220
 [&lt;ffffffff81752759&gt;] ? ip6_finish_output2+0x219/0x7b0
 [&lt;ffffffff81752759&gt;] ip6_finish_output2+0x219/0x7b0
 [&lt;ffffffff817525a5&gt;] ? ip6_finish_output2+0x65/0x7b0
 [&lt;ffffffff816cde2b&gt;] ? ip_idents_reserve+0x6b/0x80
 [&lt;ffffffff8175488f&gt;] ? ip6_fragment+0x93f/0xc50
 [&lt;ffffffff81754af1&gt;] ip6_fragment+0xba1/0xc50
 [&lt;ffffffff81752540&gt;] ? ip6_flush_pending_frames+0x40/0x40
 [&lt;ffffffff81754c6b&gt;] ip6_finish_output+0xcb/0x1d0
 [&lt;ffffffff81754dcf&gt;] ip6_output+0x5f/0x1a0
 [&lt;ffffffff81754ba0&gt;] ? ip6_fragment+0xc50/0xc50
 [&lt;ffffffff81797fbd&gt;] ip6_local_out+0x3d/0x80
 [&lt;ffffffff817554df&gt;] ip6_send_skb+0x2f/0xc0
 [&lt;ffffffff817555bd&gt;] ip6_push_pending_frames+0x4d/0x50
 [&lt;ffffffff817796cc&gt;] icmpv6_push_pending_frames+0xac/0xe0
 [&lt;ffffffff8177a4be&gt;] icmpv6_echo_reply+0x42e/0x500
 [&lt;ffffffff8177acbf&gt;] icmpv6_rcv+0x4cf/0x580
 [&lt;ffffffff81755ac7&gt;] ip6_input_finish+0x1a7/0x690
 [&lt;ffffffff81755925&gt;] ? ip6_input_finish+0x5/0x690
 [&lt;ffffffff817567a0&gt;] ip6_input+0x30/0xa0
 [&lt;ffffffff81755920&gt;] ? ip6_rcv_finish+0x1a0/0x1a0
 [&lt;ffffffff817557ce&gt;] ip6_rcv_finish+0x4e/0x1a0
 [&lt;ffffffff8175640f&gt;] ipv6_rcv+0x45f/0x7c0
 [&lt;ffffffff81755fe6&gt;] ? ipv6_rcv+0x36/0x7c0
 [&lt;ffffffff81755780&gt;] ? ip6_make_skb+0x1c0/0x1c0
 [&lt;ffffffff8168b649&gt;] __netif_receive_skb_core+0x229/0xb80
 [&lt;ffffffff810bdab5&gt;] ? mark_held_locks+0x75/0xa0
 [&lt;ffffffff8168c07f&gt;] ? process_backlog+0x6f/0x230
 [&lt;ffffffff8168bfb6&gt;] __netif_receive_skb+0x16/0x70
 [&lt;ffffffff8168c088&gt;] process_backlog+0x78/0x230
 [&lt;ffffffff8168c0ed&gt;] ? process_backlog+0xdd/0x230
 [&lt;ffffffff8168db43&gt;] net_rx_action+0x203/0x480
 [&lt;ffffffff810bdab5&gt;] ? mark_held_locks+0x75/0xa0
 [&lt;ffffffff817c156e&gt;] __do_softirq+0xde/0x49f
 [&lt;ffffffff81752768&gt;] ? ip6_finish_output2+0x228/0x7b0
 [&lt;ffffffff817c070c&gt;] do_softirq_own_stack+0x1c/0x30
 &lt;EOI&gt;
 [&lt;ffffffff8106f88b&gt;] do_softirq.part.18+0x3b/0x40
 [&lt;ffffffff8106f946&gt;] __local_bh_enable_ip+0xb6/0xc0
 [&lt;ffffffff81752791&gt;] ip6_finish_output2+0x251/0x7b0
 [&lt;ffffffff81754af1&gt;] ? ip6_fragment+0xba1/0xc50
 [&lt;ffffffff816cde2b&gt;] ? ip_idents_reserve+0x6b/0x80
 [&lt;ffffffff8175488f&gt;] ? ip6_fragment+0x93f/0xc50
 [&lt;ffffffff81754af1&gt;] ip6_fragment+0xba1/0xc50
 [&lt;ffffffff81752540&gt;] ? ip6_flush_pending_frames+0x40/0x40
 [&lt;ffffffff81754c6b&gt;] ip6_finish_output+0xcb/0x1d0
 [&lt;ffffffff81754dcf&gt;] ip6_output+0x5f/0x1a0
 [&lt;ffffffff81754ba0&gt;] ? ip6_fragment+0xc50/0xc50
 [&lt;ffffffff81797fbd&gt;] ip6_local_out+0x3d/0x80
 [&lt;ffffffff817554df&gt;] ip6_send_skb+0x2f/0xc0
 [&lt;ffffffff817555bd&gt;] ip6_push_pending_frames+0x4d/0x50
 [&lt;ffffffff81778558&gt;] rawv6_sendmsg+0xa28/0xe30
 [&lt;ffffffff81719097&gt;] ? inet_sendmsg+0xc7/0x1d0
 [&lt;ffffffff817190d6&gt;] inet_sendmsg+0x106/0x1d0
 [&lt;ffffffff81718fd5&gt;] ? inet_sendmsg+0x5/0x1d0
 [&lt;ffffffff8166d078&gt;] sock_sendmsg+0x38/0x50
 [&lt;ffffffff8166d4d6&gt;] SYSC_sendto+0xf6/0x170
 [&lt;ffffffff8100201b&gt;] ? trace_hardirqs_on_thunk+0x1b/0x1d
 [&lt;ffffffff8166e38e&gt;] SyS_sendto+0xe/0x10
 [&lt;ffffffff817bebe5&gt;] entry_SYSCALL_64_fastpath+0x18/0xa8
Code: 06 48 83 3f 00 75 26 48 8b 87 d8 00 00 00 2b 87 d0 00 00 00 48 39 d0 72 14 8b 87 e4 00 00 00 83 f8 01 75 09 48 83 7f 18 00 74 9a &lt;0f&gt; 0b 41 8b 86 cc 00 00 00 49 8#
RIP  [&lt;ffffffff8175468a&gt;] ip6_fragment+0x73a/0xc50
 RSP &lt;ffff880072803120&gt;

Fixes: 029f7f3b8701 ("netfilter: ipv6: nf_defrag: avoid/free clone
operations")
Reported-by: Daniele Di Proietto &lt;diproiettod@vmware.com&gt;
Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the IPv6 counterpart to commit 8282f27449bf ("inet: frag: Always
orphan skbs inside ip_defrag()").

Prior to commit 029f7f3b8701 ("netfilter: ipv6: nf_defrag: avoid/free
clone operations"), ipv6 fragments sent to nf_ct_frag6_gather() would be
cloned (implicitly orphaning) prior to queueing for reassembly. As such,
when the IPv6 message is eventually reassembled, the skb-&gt;sk for all
fragments would be NULL. After that commit was introduced, rather than
cloning, the original skbs were queued directly without orphaning. The
end result is that all frags except for the first and last may have a
socket attached.

This commit explicitly orphans such skbs during nf_ct_frag6_gather() to
prevent BUG_ON(skb-&gt;sk) during a later call to ip6_fragment().

kernel BUG at net/ipv6/ip6_output.c:631!
[...]
Call Trace:
 &lt;IRQ&gt;
 [&lt;ffffffff810be8f7&gt;] ? __lock_acquire+0x927/0x20a0
 [&lt;ffffffffa042c7c0&gt;] ? do_output.isra.28+0x1b0/0x1b0 [openvswitch]
 [&lt;ffffffff810bb8a2&gt;] ? __lock_is_held+0x52/0x70
 [&lt;ffffffffa042c587&gt;] ovs_fragment+0x1f7/0x280 [openvswitch]
 [&lt;ffffffff810bdab5&gt;] ? mark_held_locks+0x75/0xa0
 [&lt;ffffffff817be416&gt;] ? _raw_spin_unlock_irqrestore+0x36/0x50
 [&lt;ffffffff81697ea0&gt;] ? dst_discard_out+0x20/0x20
 [&lt;ffffffff81697e80&gt;] ? dst_ifdown+0x80/0x80
 [&lt;ffffffffa042c703&gt;] do_output.isra.28+0xf3/0x1b0 [openvswitch]
 [&lt;ffffffffa042d279&gt;] do_execute_actions+0x709/0x12c0 [openvswitch]
 [&lt;ffffffffa04340a4&gt;] ? ovs_flow_stats_update+0x74/0x1e0 [openvswitch]
 [&lt;ffffffffa04340d1&gt;] ? ovs_flow_stats_update+0xa1/0x1e0 [openvswitch]
 [&lt;ffffffff817be387&gt;] ? _raw_spin_unlock+0x27/0x40
 [&lt;ffffffffa042de75&gt;] ovs_execute_actions+0x45/0x120 [openvswitch]
 [&lt;ffffffffa0432d65&gt;] ovs_dp_process_packet+0x85/0x150 [openvswitch]
 [&lt;ffffffff817be387&gt;] ? _raw_spin_unlock+0x27/0x40
 [&lt;ffffffffa042def4&gt;] ovs_execute_actions+0xc4/0x120 [openvswitch]
 [&lt;ffffffffa0432d65&gt;] ovs_dp_process_packet+0x85/0x150 [openvswitch]
 [&lt;ffffffffa04337f2&gt;] ? key_extract+0x442/0xc10 [openvswitch]
 [&lt;ffffffffa043b26d&gt;] ovs_vport_receive+0x5d/0xb0 [openvswitch]
 [&lt;ffffffff810be8f7&gt;] ? __lock_acquire+0x927/0x20a0
 [&lt;ffffffff810be8f7&gt;] ? __lock_acquire+0x927/0x20a0
 [&lt;ffffffff810be8f7&gt;] ? __lock_acquire+0x927/0x20a0
 [&lt;ffffffff817be416&gt;] ? _raw_spin_unlock_irqrestore+0x36/0x50
 [&lt;ffffffffa043c11d&gt;] internal_dev_xmit+0x6d/0x150 [openvswitch]
 [&lt;ffffffffa043c0b5&gt;] ? internal_dev_xmit+0x5/0x150 [openvswitch]
 [&lt;ffffffff8168fb5f&gt;] dev_hard_start_xmit+0x2df/0x660
 [&lt;ffffffff8168f5ea&gt;] ? validate_xmit_skb.isra.105.part.106+0x1a/0x2b0
 [&lt;ffffffff81690925&gt;] __dev_queue_xmit+0x8f5/0x950
 [&lt;ffffffff81690080&gt;] ? __dev_queue_xmit+0x50/0x950
 [&lt;ffffffff810bdab5&gt;] ? mark_held_locks+0x75/0xa0
 [&lt;ffffffff81690990&gt;] dev_queue_xmit+0x10/0x20
 [&lt;ffffffff8169a418&gt;] neigh_resolve_output+0x178/0x220
 [&lt;ffffffff81752759&gt;] ? ip6_finish_output2+0x219/0x7b0
 [&lt;ffffffff81752759&gt;] ip6_finish_output2+0x219/0x7b0
 [&lt;ffffffff817525a5&gt;] ? ip6_finish_output2+0x65/0x7b0
 [&lt;ffffffff816cde2b&gt;] ? ip_idents_reserve+0x6b/0x80
 [&lt;ffffffff8175488f&gt;] ? ip6_fragment+0x93f/0xc50
 [&lt;ffffffff81754af1&gt;] ip6_fragment+0xba1/0xc50
 [&lt;ffffffff81752540&gt;] ? ip6_flush_pending_frames+0x40/0x40
 [&lt;ffffffff81754c6b&gt;] ip6_finish_output+0xcb/0x1d0
 [&lt;ffffffff81754dcf&gt;] ip6_output+0x5f/0x1a0
 [&lt;ffffffff81754ba0&gt;] ? ip6_fragment+0xc50/0xc50
 [&lt;ffffffff81797fbd&gt;] ip6_local_out+0x3d/0x80
 [&lt;ffffffff817554df&gt;] ip6_send_skb+0x2f/0xc0
 [&lt;ffffffff817555bd&gt;] ip6_push_pending_frames+0x4d/0x50
 [&lt;ffffffff817796cc&gt;] icmpv6_push_pending_frames+0xac/0xe0
 [&lt;ffffffff8177a4be&gt;] icmpv6_echo_reply+0x42e/0x500
 [&lt;ffffffff8177acbf&gt;] icmpv6_rcv+0x4cf/0x580
 [&lt;ffffffff81755ac7&gt;] ip6_input_finish+0x1a7/0x690
 [&lt;ffffffff81755925&gt;] ? ip6_input_finish+0x5/0x690
 [&lt;ffffffff817567a0&gt;] ip6_input+0x30/0xa0
 [&lt;ffffffff81755920&gt;] ? ip6_rcv_finish+0x1a0/0x1a0
 [&lt;ffffffff817557ce&gt;] ip6_rcv_finish+0x4e/0x1a0
 [&lt;ffffffff8175640f&gt;] ipv6_rcv+0x45f/0x7c0
 [&lt;ffffffff81755fe6&gt;] ? ipv6_rcv+0x36/0x7c0
 [&lt;ffffffff81755780&gt;] ? ip6_make_skb+0x1c0/0x1c0
 [&lt;ffffffff8168b649&gt;] __netif_receive_skb_core+0x229/0xb80
 [&lt;ffffffff810bdab5&gt;] ? mark_held_locks+0x75/0xa0
 [&lt;ffffffff8168c07f&gt;] ? process_backlog+0x6f/0x230
 [&lt;ffffffff8168bfb6&gt;] __netif_receive_skb+0x16/0x70
 [&lt;ffffffff8168c088&gt;] process_backlog+0x78/0x230
 [&lt;ffffffff8168c0ed&gt;] ? process_backlog+0xdd/0x230
 [&lt;ffffffff8168db43&gt;] net_rx_action+0x203/0x480
 [&lt;ffffffff810bdab5&gt;] ? mark_held_locks+0x75/0xa0
 [&lt;ffffffff817c156e&gt;] __do_softirq+0xde/0x49f
 [&lt;ffffffff81752768&gt;] ? ip6_finish_output2+0x228/0x7b0
 [&lt;ffffffff817c070c&gt;] do_softirq_own_stack+0x1c/0x30
 &lt;EOI&gt;
 [&lt;ffffffff8106f88b&gt;] do_softirq.part.18+0x3b/0x40
 [&lt;ffffffff8106f946&gt;] __local_bh_enable_ip+0xb6/0xc0
 [&lt;ffffffff81752791&gt;] ip6_finish_output2+0x251/0x7b0
 [&lt;ffffffff81754af1&gt;] ? ip6_fragment+0xba1/0xc50
 [&lt;ffffffff816cde2b&gt;] ? ip_idents_reserve+0x6b/0x80
 [&lt;ffffffff8175488f&gt;] ? ip6_fragment+0x93f/0xc50
 [&lt;ffffffff81754af1&gt;] ip6_fragment+0xba1/0xc50
 [&lt;ffffffff81752540&gt;] ? ip6_flush_pending_frames+0x40/0x40
 [&lt;ffffffff81754c6b&gt;] ip6_finish_output+0xcb/0x1d0
 [&lt;ffffffff81754dcf&gt;] ip6_output+0x5f/0x1a0
 [&lt;ffffffff81754ba0&gt;] ? ip6_fragment+0xc50/0xc50
 [&lt;ffffffff81797fbd&gt;] ip6_local_out+0x3d/0x80
 [&lt;ffffffff817554df&gt;] ip6_send_skb+0x2f/0xc0
 [&lt;ffffffff817555bd&gt;] ip6_push_pending_frames+0x4d/0x50
 [&lt;ffffffff81778558&gt;] rawv6_sendmsg+0xa28/0xe30
 [&lt;ffffffff81719097&gt;] ? inet_sendmsg+0xc7/0x1d0
 [&lt;ffffffff817190d6&gt;] inet_sendmsg+0x106/0x1d0
 [&lt;ffffffff81718fd5&gt;] ? inet_sendmsg+0x5/0x1d0
 [&lt;ffffffff8166d078&gt;] sock_sendmsg+0x38/0x50
 [&lt;ffffffff8166d4d6&gt;] SYSC_sendto+0xf6/0x170
 [&lt;ffffffff8100201b&gt;] ? trace_hardirqs_on_thunk+0x1b/0x1d
 [&lt;ffffffff8166e38e&gt;] SyS_sendto+0xe/0x10
 [&lt;ffffffff817bebe5&gt;] entry_SYSCALL_64_fastpath+0x18/0xa8
Code: 06 48 83 3f 00 75 26 48 8b 87 d8 00 00 00 2b 87 d0 00 00 00 48 39 d0 72 14 8b 87 e4 00 00 00 83 f8 01 75 09 48 83 7f 18 00 74 9a &lt;0f&gt; 0b 41 8b 86 cc 00 00 00 49 8#
RIP  [&lt;ffffffff8175468a&gt;] ip6_fragment+0x73a/0xc50
 RSP &lt;ffff880072803120&gt;

Fixes: 029f7f3b8701 ("netfilter: ipv6: nf_defrag: avoid/free clone
operations")
Reported-by: Daniele Di Proietto &lt;diproiettod@vmware.com&gt;
Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: connlabels: change nf_connlabels_get bit arg to 'highest used'</title>
<updated>2016-04-18T18:39:48+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2016-04-12T16:14:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=adff6c65600000ec2bb71840c943ee12668080f5'/>
<id>adff6c65600000ec2bb71840c943ee12668080f5</id>
<content type='text'>
nf_connlabel_set() takes the bit number that we would like to set.
nf_connlabels_get() however took the number of bits that we want to
support.

So e.g. nf_connlabels_get(32) support bits 0 to 31, but not 32.
This changes nf_connlabels_get() to take the highest bit that we want
to set.

Callers then don't have to cope with a potential integer wrap
when using nf_connlabels_get(bit + 1) anymore.

Current callers are fine, this change is only to make folloup
nft ct label set support simpler.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
nf_connlabel_set() takes the bit number that we would like to set.
nf_connlabels_get() however took the number of bits that we want to
support.

So e.g. nf_connlabels_get(32) support bits 0 to 31, but not 32.
This changes nf_connlabels_get() to take the highest bit that we want
to set.

Callers then don't have to cope with a potential integer wrap
when using nf_connlabels_get(bit + 1) anymore.

Current callers are fine, this change is only to make folloup
nft ct label set support simpler.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf</title>
<updated>2016-03-28T19:38:59+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2016-03-28T19:38:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0c84ea17ff22df83d72b20e336ae69d6035c8bbf'/>
<id>0c84ea17ff22df83d72b20e336ae69d6035c8bbf</id>
<content type='text'>
Pablo Neira Ayuso says:

====================
Netfilter fixes for net

The following patchset contains Netfilter fixes for you net tree,
they are:

1) There was a race condition between parallel save/swap and delete,
   which resulted a kernel crash due to the increase ref for save, swap,
   wrong ref decrease operations. Reported and fixed by Vishwanath Pai.

2) OVS should call into CT NAT for packets of new expected connections only
   when the conntrack state is persisted with the 'commit' option to the
   OVS CT action. From Jarno Rajahalme.

3) Resolve kconfig dependencies with new OVS NAT support. From Arnd Bergmann.

4) Early validation of entry-&gt;target_offset to make sure it doesn't take us
   out from the blob, from Florian Westphal.

5) Again early validation of entry-&gt;next_offset to make sure it doesn't take
   out from the blob, also from Florian.

6) Check that entry-&gt;target_offset is always of of sizeof(struct xt_entry)
   for unconditional entries, when checking both from check_underflow()
   and when checking for loops in mark_source_chains(), again from
   Florian.

7) Fix inconsistent behaviour in nfnetlink_queue when
   NFQA_CFG_F_FAIL_OPEN is set and netlink_unicast() fails due to buffer
   overrun, we have to reinject the packet as the user expects.

8) Enforce nul-terminated table names from getsockopt GET_ENTRIES
   requests.

9) Don't assume skb-&gt;sk is set from nft_bridge_reject and synproxy,
   this fixes a recent update of the code to namespaceify
   ip_default_ttl, patch from Liping Zhang.

This batch comes with four patches to validate x_tables blobs coming
from userspace. CONFIG_USERNS exposes the x_tables interface to
unpriviledged users and to be honest this interface never received the
attention for this move away from the CAP_NET_ADMIN domain. Florian is
working on another round with more patches with more sanity checks, so
expect a bit more Netfilter fixes in this development cycle than usual.
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pablo Neira Ayuso says:

====================
Netfilter fixes for net

The following patchset contains Netfilter fixes for you net tree,
they are:

1) There was a race condition between parallel save/swap and delete,
   which resulted a kernel crash due to the increase ref for save, swap,
   wrong ref decrease operations. Reported and fixed by Vishwanath Pai.

2) OVS should call into CT NAT for packets of new expected connections only
   when the conntrack state is persisted with the 'commit' option to the
   OVS CT action. From Jarno Rajahalme.

3) Resolve kconfig dependencies with new OVS NAT support. From Arnd Bergmann.

4) Early validation of entry-&gt;target_offset to make sure it doesn't take us
   out from the blob, from Florian Westphal.

5) Again early validation of entry-&gt;next_offset to make sure it doesn't take
   out from the blob, also from Florian.

6) Check that entry-&gt;target_offset is always of of sizeof(struct xt_entry)
   for unconditional entries, when checking both from check_underflow()
   and when checking for loops in mark_source_chains(), again from
   Florian.

7) Fix inconsistent behaviour in nfnetlink_queue when
   NFQA_CFG_F_FAIL_OPEN is set and netlink_unicast() fails due to buffer
   overrun, we have to reinject the packet as the user expects.

8) Enforce nul-terminated table names from getsockopt GET_ENTRIES
   requests.

9) Don't assume skb-&gt;sk is set from nft_bridge_reject and synproxy,
   this fixes a recent update of the code to namespaceify
   ip_default_ttl, patch from Liping Zhang.

This batch comes with four patches to validate x_tables blobs coming
from userspace. CONFIG_USERNS exposes the x_tables interface to
unpriviledged users and to be honest this interface never received the
attention for this move away from the CAP_NET_ADMIN domain. Florian is
working on another round with more patches with more sanity checks, so
expect a bit more Netfilter fixes in this development cycle than usual.
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: call only into reachable nf-nat code</title>
<updated>2016-03-28T15:58:59+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-03-18T13:33:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=99b7248e2ad57ca93ada10c6598affb267ffc99a'/>
<id>99b7248e2ad57ca93ada10c6598affb267ffc99a</id>
<content type='text'>
The openvswitch code has gained support for calling into the
nf-nat-ipv4/ipv6 modules, however those can be loadable modules
in a configuration in which openvswitch is built-in, leading
to link errors:

net/built-in.o: In function `__ovs_ct_lookup':
:(.text+0x2cc2c8): undefined reference to `nf_nat_icmp_reply_translation'
:(.text+0x2cc66c): undefined reference to `nf_nat_icmpv6_reply_translation'

The dependency on (!NF_NAT || NF_NAT) prevents similar issues,
but NF_NAT is set to 'y' if any of the symbols selecting
it are built-in, but the link error happens when any of them
are modular.

A second issue is that even if CONFIG_NF_NAT_IPV6 is built-in,
CONFIG_NF_NAT_IPV4 might be completely disabled. This is unlikely
to be useful in practice, but the driver currently only handles
IPv6 being optional.

This patch improves the Kconfig dependency so that openvswitch
cannot be built-in if either of the two other symbols are set
to 'm', and it replaces the incorrect #ifdef in ovs_ct_nat_execute()
with two "if (IS_ENABLED())" checks that should catch all corner
cases also make the code more readable.

The same #ifdef exists ovs_ct_nat_to_attr(), where it does not
cause a link error, but for consistency I'm changing it the same
way.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 05752523e565 ("openvswitch: Interface with NAT.")
Acked-by: Joe Stringer &lt;joe@ovn.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The openvswitch code has gained support for calling into the
nf-nat-ipv4/ipv6 modules, however those can be loadable modules
in a configuration in which openvswitch is built-in, leading
to link errors:

net/built-in.o: In function `__ovs_ct_lookup':
:(.text+0x2cc2c8): undefined reference to `nf_nat_icmp_reply_translation'
:(.text+0x2cc66c): undefined reference to `nf_nat_icmpv6_reply_translation'

The dependency on (!NF_NAT || NF_NAT) prevents similar issues,
but NF_NAT is set to 'y' if any of the symbols selecting
it are built-in, but the link error happens when any of them
are modular.

A second issue is that even if CONFIG_NF_NAT_IPV6 is built-in,
CONFIG_NF_NAT_IPV4 might be completely disabled. This is unlikely
to be useful in practice, but the driver currently only handles
IPv6 being optional.

This patch improves the Kconfig dependency so that openvswitch
cannot be built-in if either of the two other symbols are set
to 'm', and it replaces the incorrect #ifdef in ovs_ct_nat_execute()
with two "if (IS_ENABLED())" checks that should catch all corner
cases also make the code more readable.

The same #ifdef exists ovs_ct_nat_to_attr(), where it does not
cause a link error, but for consistency I'm changing it the same
way.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 05752523e565 ("openvswitch: Interface with NAT.")
Acked-by: Joe Stringer &lt;joe@ovn.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: Fix checking for new expected connections.</title>
<updated>2016-03-28T15:58:51+00:00</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jarno@ovn.org</email>
</author>
<published>2016-03-21T18:15:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5745b0be05a0f8ccbc92a36b69f3a6bc58e91954'/>
<id>5745b0be05a0f8ccbc92a36b69f3a6bc58e91954</id>
<content type='text'>
OVS should call into CT NAT for packets of new expected connections only
when the conntrack state is persisted with the 'commit' option to the
OVS CT action.  The test for this condition is doubly wrong, as the CT
status field is ANDed with the bit number (IPS_EXPECTED_BIT) rather
than the mask (IPS_EXPECTED), and due to the wrong assumption that the
expected bit would apply only for the first (i.e., 'new') packet of a
connection, while in fact the expected bit remains on for the lifetime of
an expected connection.  The 'ctinfo' value IP_CT_RELATED derived from
the ct status can be used instead, as it is only ever applicable to
the 'new' packets of the expected connection.

Fixes: 05752523e565 ('openvswitch: Interface with NAT.')
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OVS should call into CT NAT for packets of new expected connections only
when the conntrack state is persisted with the 'commit' option to the
OVS CT action.  The test for this condition is doubly wrong, as the CT
status field is ANDed with the bit number (IPS_EXPECTED_BIT) rather
than the mask (IPS_EXPECTED), and due to the wrong assumption that the
expected bit would apply only for the first (i.e., 'new') packet of a
connection, while in fact the expected bit remains on for the lifetime of
an expected connection.  The 'ctinfo' value IP_CT_RELATED derived from
the ct status can be used instead, as it is only ever applicable to
the 'new' packets of the expected connection.

Fixes: 05752523e565 ('openvswitch: Interface with NAT.')
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
