<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/netfilter, branch v3.13</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/net/netfilter?h=v3.13</id>
<link rel='self' href='https://git.amat.us/linux/atom/net/netfilter?h=v3.13'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-01-06T13:23:17Z</updated>
<entry>
<title>netfilter: only warn once on wrong seqadj usage</title>
<updated>2014-01-06T13:23:17Z</updated>
<author>
<name>Jesper Dangaard Brouer</name>
<email>brouer@redhat.com</email>
</author>
<published>2014-01-04T13:10:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f2661adc0c134d890d84c32d7cb54a2b4d1f0a5f'/>
<id>urn:sha1:f2661adc0c134d890d84c32d7cb54a2b4d1f0a5f</id>
<content type='text'>
Avoid potentially spamming the kernel log with WARN splash messages
when catching wrong usage of seqadj, by simply using WARN_ONCE.

This is a followup to commit db12cf274353 (netfilter: WARN about
wrong usage of sequence number adjustments)

Suggested-by: Flavio Leitner &lt;fbl@redhat.com&gt;
Suggested-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Suggested-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_nat: fix access to uninitialized buffer in IRC NAT helper</title>
<updated>2014-01-06T13:17:17Z</updated>
<author>
<name>Daniel Borkmann</name>
<email>dborkman@redhat.com</email>
</author>
<published>2013-12-31T15:28:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2690d97ade05c5325cbf7c72b94b90d265659886'/>
<id>urn:sha1:2690d97ade05c5325cbf7c72b94b90d265659886</id>
<content type='text'>
Commit 5901b6be885e attempted to introduce IPv6 support into
IRC NAT helper. By doing so, the following code seemed to be removed
by accident:

  ip = ntohl(exp-&gt;master-&gt;tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip);
  sprintf(buffer, "%u %u", ip, port);
  pr_debug("nf_nat_irc: inserting '%s' == %pI4, port %u\n", buffer, &amp;ip, port);

This leads to the fact that buffer[] was left uninitialized and
contained some stack value. When we call nf_nat_mangle_tcp_packet(),
we call strlen(buffer) on excatly this uninitialized buffer. If we
are unlucky and the skb has enough tailroom, we overwrite resp. leak
contents with values that sit on our stack into the packet and send
that out to the receiver.

Since the rather informal DCC spec [1] does not seem to specify
IPv6 support right now, we log such occurences so that admins can
act accordingly, and drop the packet. I've looked into XChat source,
and IPv6 is not supported there: addresses are in u32 and print
via %u format string.

Therefore, restore old behaviour as in IPv4, use snprintf(). The
IRC helper does not support IPv6 by now. By this, we can safely use
strlen(buffer) in nf_nat_mangle_tcp_packet() and prevent a buffer
overflow. Also simplify some code as we now have ct variable anyway.

  [1] http://www.irchelp.org/irchelp/rfc/ctcpspec.html

Fixes: 5901b6be885e ("netfilter: nf_nat: support IPv6 in IRC NAT helper")
Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Harald Welte &lt;laforge@gnumonks.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_tables: fix wrong datatype in nft_validate_data_load()</title>
<updated>2013-12-28T21:32:28Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2013-12-27T23:59:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2ee0d3c80fdb7974cfa1c7e25b5048e9fcaf69b6'/>
<id>urn:sha1:2ee0d3c80fdb7974cfa1c7e25b5048e9fcaf69b6</id>
<content type='text'>
This patch fixes dictionary mappings, eg.

 add rule ip filter input meta dnat set tcp dport map { 22 =&gt; 1.1.1.1, 23 =&gt; 2.2.2.2 }

The kernel was returning -EINVAL in nft_validate_data_load() since
the type of the set element data that is passed was the real userspace
datatype instead of NFT_DATA_VALUE.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_tables: fix oops when updating table with user chains</title>
<updated>2013-12-28T11:18:16Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2013-12-27T09:44:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d2012975619251bdfeb7a5159faa7727ea9cddd3'/>
<id>urn:sha1:d2012975619251bdfeb7a5159faa7727ea9cddd3</id>
<content type='text'>
This patch fixes a crash while trying to deactivate a table that
contains user chains. You can reproduce it via:

% nft add table table1
% nft add chain table1 chain1
% nft-table-upd ip table1 dormant

[  253.021026] BUG: unable to handle kernel NULL pointer dereference at 0000000000000030
[  253.021114] IP: [&lt;ffffffff8134cebd&gt;] nf_register_hook+0x35/0x6f
[  253.021167] PGD 30fa5067 PUD 30fa2067 PMD 0
[  253.021208] Oops: 0000 [#1] SMP
[...]
[  253.023305] Call Trace:
[  253.023331]  [&lt;ffffffffa0885020&gt;] nf_tables_newtable+0x11c/0x258 [nf_tables]
[  253.023385]  [&lt;ffffffffa0878592&gt;] nfnetlink_rcv_msg+0x1f4/0x226 [nfnetlink]
[  253.023438]  [&lt;ffffffffa0878418&gt;] ? nfnetlink_rcv_msg+0x7a/0x226 [nfnetlink]
[  253.023491]  [&lt;ffffffffa087839e&gt;] ? nfnetlink_bind+0x45/0x45 [nfnetlink]
[  253.023542]  [&lt;ffffffff8134b47e&gt;] netlink_rcv_skb+0x3c/0x88
[  253.023586]  [&lt;ffffffffa0878973&gt;] nfnetlink_rcv+0x3af/0x3e4 [nfnetlink]
[  253.023638]  [&lt;ffffffff813fb0d4&gt;] ? _raw_read_unlock+0x22/0x34
[  253.023683]  [&lt;ffffffff8134af17&gt;] netlink_unicast+0xe2/0x161
[  253.023727]  [&lt;ffffffff8134b29a&gt;] netlink_sendmsg+0x304/0x332
[  253.023773]  [&lt;ffffffff8130d250&gt;] __sock_sendmsg_nosec+0x25/0x27
[  253.023820]  [&lt;ffffffff8130fb93&gt;] sock_sendmsg+0x5a/0x7b
[  253.023861]  [&lt;ffffffff8130d5d5&gt;] ? copy_from_user+0x2a/0x2c
[  253.023905]  [&lt;ffffffff8131066f&gt;] ? move_addr_to_kernel+0x35/0x60
[  253.023952]  [&lt;ffffffff813107b3&gt;] SYSC_sendto+0x119/0x15c
[  253.023995]  [&lt;ffffffff81401107&gt;] ? sysret_check+0x1b/0x56
[  253.024039]  [&lt;ffffffff8108dc30&gt;] ? trace_hardirqs_on_caller+0x140/0x1db
[  253.024090]  [&lt;ffffffff8120164e&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f
[  253.024141]  [&lt;ffffffff81310caf&gt;] SyS_sendto+0x9/0xb
[  253.026219]  [&lt;ffffffff814010e2&gt;] system_call_fastpath+0x16/0x1b

Reported-by: Alex Wei &lt;alex.kern.mentor@gmail.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_tables: fix dumping with large number of sets</title>
<updated>2013-12-28T11:14:42Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2013-12-24T17:32:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e38195bf32d7ccb2ae3f56f36b895daf455ffd94'/>
<id>urn:sha1:e38195bf32d7ccb2ae3f56f36b895daf455ffd94</id>
<content type='text'>
If not table name is specified, the dumping of the existing sets
may be incomplete with a sufficiently large number of sets and
tables. This patch fixes missing reset of the cursors after
finding the location of the last object that has been included
in the previous multi-part message.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>ipvs: correct usage/allocation of seqadj ext in ipvs</title>
<updated>2013-12-27T03:30:02Z</updated>
<author>
<name>Jesper Dangaard Brouer</name>
<email>brouer@redhat.com</email>
</author>
<published>2013-12-16T16:09:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b25adce1606427fd88da08f5203714cada7f6a98'/>
<id>urn:sha1:b25adce1606427fd88da08f5203714cada7f6a98</id>
<content type='text'>
The IPVS FTP helper ip_vs_ftp could trigger an OOPS in nf_ct_seqadj_set,
after commit 41d73ec053d2 (netfilter: nf_conntrack: make sequence number
adjustments usuable without NAT).

This is because, the seqadj ext is now allocated dynamically, and the
IPVS code didn't handle this situation.  Fix this in the IPVS nfct
code by invoking the alloc function nfct_seqadj_ext_add().

Fixes: 41d73ec053d2 (netfilter: nf_conntrack: make sequence number adjustments usuable without NAT)
Suggested-by: Julian Anastasov &lt;ja@ssi.bg&gt;
Signed-off-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Acked-by: Julian Anastasov &lt;ja@ssi.bg&gt;
Signed-off-by: Simon Horman &lt;horms@verge.net.au&gt;
</content>
</entry>
<entry>
<title>netfilter: WARN about wrong usage of sequence number adjustments</title>
<updated>2013-12-27T03:29:54Z</updated>
<author>
<name>Jesper Dangaard Brouer</name>
<email>brouer@redhat.com</email>
</author>
<published>2013-12-16T16:09:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=db12cf27435356017e7ab375ef5e82a1cc749384'/>
<id>urn:sha1:db12cf27435356017e7ab375ef5e82a1cc749384</id>
<content type='text'>
Since commit 41d73ec053d2 (netfilter: nf_conntrack: make sequence
number adjustments usuable without NAT), the sequence number extension
is dynamically allocated.

Instead of dying, give a WARN splash, in case of wrong usage of the
seqadj code, e.g. when forgetting to allocate via nfct_seqadj_ext_add().

Wrong usage have been seen in the IPVS code path.

Signed-off-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Acked-by: Julian Anastasov &lt;ja@ssi.bg&gt;
Signed-off-by: Simon Horman &lt;horms@verge.net.au&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_ct_timestamp: Fix BUG_ON after netns deletion</title>
<updated>2013-12-20T13:58:29Z</updated>
<author>
<name>Helmut Schaa</name>
<email>helmut.schaa@googlemail.com</email>
</author>
<published>2013-12-20T13:41:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=443d20fd188208aa4df2118ad49f9168e411016d'/>
<id>urn:sha1:443d20fd188208aa4df2118ad49f9168e411016d</id>
<content type='text'>
When having nf_conntrack_timestamp enabled deleting a netns
can lead to the following BUG being triggered:

[63836.660000] Kernel bug detected[#1]:
[63836.660000] CPU: 0 PID: 0 Comm: swapper Not tainted 3.10.18 #14
[63836.660000] task: 802d9420 ti: 802d2000 task.ti: 802d2000
[63836.660000] $ 0   : 00000000 00000000 00000000 00000000
[63836.660000] $ 4   : 00000001 00000004 00000020 00000020
[63836.660000] $ 8   : 00000000 80064910 00000000 00000000
[63836.660000] $12   : 0bff0002 00000001 00000000 0a0a0abe
[63836.660000] $16   : 802e70a0 85f29d80 00000000 00000004
[63836.660000] $20   : 85fb62a0 00000002 802d3bc0 85fb62a0
[63836.660000] $24   : 00000000 87138110
[63836.660000] $28   : 802d2000 802d3b40 00000014 871327cc
[63836.660000] Hi    : 000005ff
[63836.660000] Lo    : f2edd000
[63836.660000] epc   : 87138794 __nf_ct_ext_add_length+0xe8/0x1ec [nf_conntrack]
[63836.660000]     Not tainted
[63836.660000] ra    : 871327cc nf_conntrack_in+0x31c/0x7b8 [nf_conntrack]
[63836.660000] Status: 1100d403 KERNEL EXL IE
[63836.660000] Cause : 00800034
[63836.660000] PrId  : 0001974c (MIPS 74Kc)
[63836.660000] Modules linked in: ath9k ath9k_common pppoe ppp_async iptable_nat ath9k_hw ath pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv4 mac80211 ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_quota xt_policy xt_pkttype xt_owner xt_nat xt_multiport xt_mark xh
[63836.660000] Process swapper (pid: 0, threadinfo=802d2000, task=802d9420, tls=00000000)
[63836.660000] Stack : 802e70a0 871323d4 00000005 87080234 802e70a0 86d2a840 00000000 00000000
[63836.660000] Call Trace:
[63836.660000] [&lt;87138794&gt;] __nf_ct_ext_add_length+0xe8/0x1ec [nf_conntrack]
[63836.660000] [&lt;871327cc&gt;] nf_conntrack_in+0x31c/0x7b8 [nf_conntrack]
[63836.660000] [&lt;801ff63c&gt;] nf_iterate+0x90/0xec
[63836.660000] [&lt;801ff730&gt;] nf_hook_slow+0x98/0x164
[63836.660000] [&lt;80205968&gt;] ip_rcv+0x3e8/0x40c
[63836.660000] [&lt;801d9754&gt;] __netif_receive_skb_core+0x624/0x6a4
[63836.660000] [&lt;801da124&gt;] process_backlog+0xa4/0x16c
[63836.660000] [&lt;801d9bb4&gt;] net_rx_action+0x10c/0x1e0
[63836.660000] [&lt;8007c5a4&gt;] __do_softirq+0xd0/0x1bc
[63836.660000] [&lt;8007c730&gt;] do_softirq+0x48/0x68
[63836.660000] [&lt;8007c964&gt;] irq_exit+0x54/0x70
[63836.660000] [&lt;80060830&gt;] ret_from_irq+0x0/0x4
[63836.660000] [&lt;8006a9f8&gt;] r4k_wait_irqoff+0x18/0x1c
[63836.660000] [&lt;8009cfb8&gt;] cpu_startup_entry+0xa4/0x104
[63836.660000] [&lt;802eb918&gt;] start_kernel+0x394/0x3ac
[63836.660000]
[63836.660000]
Code: 00821021  8c420000  2c440001 &lt;00040336&gt; 90440011  92350010  90560010  2485ffff  02a5a821
[63837.040000] ---[ end trace ebf660c3ce3b55e7 ]---
[63837.050000] Kernel panic - not syncing: Fatal exception in interrupt
[63837.050000] Rebooting in 3 seconds..

Fix this by not unregistering the conntrack extension in the per-netns
cleanup code.

This bug was introduced in (73f4001 netfilter: nf_ct_tstamp: move
initialization out of pernet_operations).

Signed-off-by: Helmut Schaa &lt;helmut.schaa@googlemail.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nft_exthdr: call ipv6_find_hdr() with explicitly initialized offset</title>
<updated>2013-12-20T10:25:10Z</updated>
<author>
<name>Daniel Borkmann</name>
<email>dborkman@redhat.com</email>
</author>
<published>2013-12-20T10:23:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=540436c80e5918dd5ed838449e108b1726fc4d68'/>
<id>urn:sha1:540436c80e5918dd5ed838449e108b1726fc4d68</id>
<content type='text'>
In nft's nft_exthdr_eval() routine we process IPv6 extension header
through invoking ipv6_find_hdr(), but we call it with an uninitialized
offset variable that contains some stack value. In ipv6_find_hdr()
we then test if the value of offset != 0 and call skb_header_pointer()
on that offset in order to map struct ipv6hdr into it. Fix it up by
initializing offset to 0 as it was probably intended to be.

Fixes: 96518518cc41 ("netfilter: add nftables")
Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nfnetlink_log: unset nf_loggers for netns when unloading module</title>
<updated>2013-12-17T22:19:03Z</updated>
<author>
<name>Gao feng</name>
<email>gaofeng@cn.fujitsu.com</email>
</author>
<published>2013-12-16T06:59:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=45c2aff645c82da7b1574dad5062993cf451c699'/>
<id>urn:sha1:45c2aff645c82da7b1574dad5062993cf451c699</id>
<content type='text'>
Steven Rostedt and Arnaldo Carvalho de Melo reported a panic
when access the files /proc/sys/net/netfilter/nf_log/*.

This problem will occur when we do:

 echo nfnetlink_log &gt; /proc/sys/net/netfilter/nf_log/any_file
 rmmod nfnetlink_log

and then access the files.

Since the nf_loggers of netns hasn't been unset, it will point
to the memory that has been freed.

This bug is introduced by commit 9368a53c ("netfilter: nfnetlink_log:
add net namespace support for nfnetlink_log").

[17261.822047] BUG: unable to handle kernel paging request at ffffffffa0d49090
[17261.822056] IP: [&lt;ffffffff8157aba0&gt;] nf_log_proc_dostring+0xf0/0x1d0
[...]
[17261.822226] Call Trace:
[17261.822235]  [&lt;ffffffff81297b98&gt;] ? security_capable+0x18/0x20
[17261.822240]  [&lt;ffffffff8106fa09&gt;] ? ns_capable+0x29/0x50
[17261.822247]  [&lt;ffffffff8163d25f&gt;] ? net_ctl_permissions+0x1f/0x90
[17261.822254]  [&lt;ffffffff81216613&gt;] proc_sys_call_handler+0xb3/0xc0
[17261.822258]  [&lt;ffffffff81216651&gt;] proc_sys_read+0x11/0x20
[17261.822265]  [&lt;ffffffff811a80de&gt;] vfs_read+0x9e/0x170
[17261.822270]  [&lt;ffffffff811a8c09&gt;] SyS_read+0x49/0xa0
[17261.822276]  [&lt;ffffffff810e6496&gt;] ? __audit_syscall_exit+0x1f6/0x2a0
[17261.822283]  [&lt;ffffffff81656e99&gt;] system_call_fastpath+0x16/0x1b
[17261.822285] Code: cc 81 4d 63 e4 4c 89 45 88 48 89 4d 90 e8 19 03 0d 00 4b 8b 84 e5 28 08 00 00 48 8b 4d 90 4c 8b 45 88 48 85 c0 0f 84 a8 00 00 00 &lt;48&gt; 8b 40 10 48 89 43 08 48 89 df 4c 89 f2 31 f6 e8 4b 35 af ff
[17261.822329] RIP  [&lt;ffffffff8157aba0&gt;] nf_log_proc_dostring+0xf0/0x1d0
[17261.822334]  RSP &lt;ffff880274d3fe28&gt;
[17261.822336] CR2: ffffffffa0d49090
[17261.822340] ---[ end trace a14ce54c0897a90d ]---

Reported-by: Arnaldo Carvalho de Melo &lt;acme@ghostprotocols.net&gt;
Reported-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Gao feng &lt;gaofeng@cn.fujitsu.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
</feed>
