<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/net/openvswitch/conntrack.c, branch v4.6</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 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: 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>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>
<entry>
<title>openvswitch: Use proper buffer size in nla_memcpy</title>
<updated>2016-03-28T15:37:14+00:00</updated>
<author>
<name>Haishuang Yan</name>
<email>yanhaishuang@cmss.chinamobile.com</email>
</author>
<published>2016-03-28T10:08:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ac71b46efd2838c02ec193987c8f61c3ba33b495'/>
<id>ac71b46efd2838c02ec193987c8f61c3ba33b495</id>
<content type='text'>
For the input parameter count, it's better to use the size
of destination buffer size, as nla_memcpy would take into
account the length of the source netlink attribute when
a data is copied from an attribute.

Signed-off-by: Haishuang Yan &lt;yanhaishuang@cmss.chinamobile.com&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>
For the input parameter count, it's better to use the size
of destination buffer size, as nla_memcpy would take into
account the length of the source netlink attribute when
a data is copied from an attribute.

Signed-off-by: Haishuang Yan &lt;yanhaishuang@cmss.chinamobile.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: Interface with NAT.</title>
<updated>2016-03-14T22:47:29+00:00</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jarno@ovn.org</email>
</author>
<published>2016-03-10T18:54:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=05752523e56502cd9975aec0a2ded465d51a71f3'/>
<id>05752523e56502cd9975aec0a2ded465d51a71f3</id>
<content type='text'>
Extend OVS conntrack interface to cover NAT.  New nested
OVS_CT_ATTR_NAT attribute may be used to include NAT with a CT action.
A bare OVS_CT_ATTR_NAT only mangles existing and expected connections.
If OVS_NAT_ATTR_SRC or OVS_NAT_ATTR_DST is included within the nested
attributes, new (non-committed/non-confirmed) connections are mangled
according to the rest of the nested attributes.

The corresponding OVS userspace patch series includes test cases (in
tests/system-traffic.at) that also serve as example uses.

This work extends on a branch by Thomas Graf at
https://github.com/tgraf/ovs/tree/nat.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
Acked-by: Thomas Graf &lt;tgraf@suug.ch&gt;
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>
Extend OVS conntrack interface to cover NAT.  New nested
OVS_CT_ATTR_NAT attribute may be used to include NAT with a CT action.
A bare OVS_CT_ATTR_NAT only mangles existing and expected connections.
If OVS_NAT_ATTR_SRC or OVS_NAT_ATTR_DST is included within the nested
attributes, new (non-committed/non-confirmed) connections are mangled
according to the rest of the nested attributes.

The corresponding OVS userspace patch series includes test cases (in
tests/system-traffic.at) that also serve as example uses.

This work extends on a branch by Thomas Graf at
https://github.com/tgraf/ovs/tree/nat.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
Acked-by: Thomas Graf &lt;tgraf@suug.ch&gt;
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: Delay conntrack helper call for new connections.</title>
<updated>2016-03-14T22:47:29+00:00</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jarno@ovn.org</email>
</author>
<published>2016-03-10T18:54:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=28b6e0c1ace45779c60e7cefe6d469b7ecb520b8'/>
<id>28b6e0c1ace45779c60e7cefe6d469b7ecb520b8</id>
<content type='text'>
There is no need to help connections that are not confirmed, so we can
delay helping new connections to the time when they are confirmed.
This change is needed for NAT support, and having this as a separate
patch will make the following NAT patch a bit easier to review.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
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>
There is no need to help connections that are not confirmed, so we can
delay helping new connections to the time when they are confirmed.
This change is needed for NAT support, and having this as a separate
patch will make the following NAT patch a bit easier to review.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
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: Handle NF_REPEAT in conntrack action.</title>
<updated>2016-03-14T22:47:29+00:00</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jarno@ovn.org</email>
</author>
<published>2016-03-10T18:54:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5b6b929376a621e2bd3367f5de563d7123506597'/>
<id>5b6b929376a621e2bd3367f5de563d7123506597</id>
<content type='text'>
Repeat the nf_conntrack_in() call when it returns NF_REPEAT.  This
avoids dropping a SYN packet re-opening an existing TCP connection.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
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>
Repeat the nf_conntrack_in() call when it returns NF_REPEAT.  This
avoids dropping a SYN packet re-opening an existing TCP connection.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
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: Find existing conntrack entry after upcall.</title>
<updated>2016-03-14T22:47:28+00:00</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jarno@ovn.org</email>
</author>
<published>2016-03-10T18:54:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=289f225349cb2a97448fd14599ab34b741f706f3'/>
<id>289f225349cb2a97448fd14599ab34b741f706f3</id>
<content type='text'>
Add a new function ovs_ct_find_existing() to find an existing
conntrack entry for which this packet was already applied to.  This is
only to be called when there is evidence that the packet was already
tracked and committed, but we lost the ct reference due to an
userspace upcall.

ovs_ct_find_existing() is called from skb_nfct_cached(), which can now
hide the fact that the ct reference may have been lost due to an
upcall.  This allows ovs_ct_commit() to be simplified.

This patch is needed by later "openvswitch: Interface with NAT" patch,
as we need to be able to pass the packet through NAT using the
original ct reference also after the reference is lost after an
upcall.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
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>
Add a new function ovs_ct_find_existing() to find an existing
conntrack entry for which this packet was already applied to.  This is
only to be called when there is evidence that the packet was already
tracked and committed, but we lost the ct reference due to an
userspace upcall.

ovs_ct_find_existing() is called from skb_nfct_cached(), which can now
hide the fact that the ct reference may have been lost due to an
upcall.  This allows ovs_ct_commit() to be simplified.

This patch is needed by later "openvswitch: Interface with NAT" patch,
as we need to be able to pass the packet through NAT using the
original ct reference also after the reference is lost after an
upcall.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
Acked-by: Joe Stringer &lt;joe@ovn.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
