<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/net/netfilter, branch v4.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-07-08T12:55:14Z</updated>
<entry>
<title>netfilter: nft_ct: fix expiration getter</title>
<updated>2016-07-08T12:55:14Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2016-07-06T12:53:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c8607e020014cf11a61601a0005270bad81cabdf'/>
<id>urn:sha1:c8607e020014cf11a61601a0005270bad81cabdf</id>
<content type='text'>
We need to compute timeout.expires - jiffies, not the other way around.
Add a helper, another patch can then later change more places in
conntrack code where we currently open-code this.

Will allow us to only change one place later when we remove per-ct timer.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_tables: reject loops from set element jump to chain</title>
<updated>2016-06-15T10:17:23Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2016-06-11T04:20:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8588ac097b49ce8802f11541d9cd6f6667badb34'/>
<id>urn:sha1:8588ac097b49ce8802f11541d9cd6f6667badb34</id>
<content type='text'>
Liping Zhang says:

"Users may add such a wrong nft rules successfully, which will cause an
endless jump loop:

  # nft add rule filter test tcp dport vmap {1: jump test}

This is because before we commit, the element in the current anonymous
set is inactive, so osp-&gt;walk will skip this element and miss the
validate check."

To resolve this problem, this patch passes the generation mask to the
walk function through the iter container structure depending on the code
path:

1) If we're dumping the elements, then we have to check if the element
   is active in the current generation. Thus, we check for the current
   bit in the genmask.

2) If we're checking for loops, then we have to check if the element is
   active in the next generation, as we're in the middle of a
   transaction. Thus, we check for the next bit in the genmask.

Based on original patch from Liping Zhang.

Reported-by: Liping Zhang &lt;liping.zhang@spreadtrum.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Tested-by: Liping Zhang &lt;liping.zhang@spreadtrum.com&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf</title>
<updated>2016-06-02T00:54:19Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2016-06-02T00:54:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fc14963f249f9aca1ac84c9c8659b4f35e0a315e'/>
<id>urn:sha1:fc14963f249f9aca1ac84c9c8659b4f35e0a315e</id>
<content type='text'>
Pablo Neira Ayuso says:

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

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

1) Fix incorrect timestamp in nfnetlink_queue introduced when addressing
   y2038 safe timestamp, from Florian Westphal.

2) Get rid of leftover conntrack definition from the previous merge
   window, oneliner from Florian.

3) Make nf_queue handler pernet to resolve race on dereferencing the
   hook state structure with netns removal, from Eric Biederman.

4) Ensure clean exit on unregistered helper ports, from Taehee Yoo.

5) Restore FLOWI_FLAG_KNOWN_NH in nf_dup_ipv6. This got lost while
   generalizing xt_TEE to add packet duplication support in nf_tables,
   from Paolo Abeni.

6) Insufficient netlink NFTA_SET_TABLE attribute check in
   nf_tables_getset(), from Phil Turnbull.

7) Reject helper registration on duplicated ports via modparams.
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_queue: Make the queue_handler pernet</title>
<updated>2016-05-25T09:54:22Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2016-05-14T02:18:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dc3ee32e96d74dd6c80eed63af5065cb75899299'/>
<id>urn:sha1:dc3ee32e96d74dd6c80eed63af5065cb75899299</id>
<content type='text'>
Florian Weber reported:
&gt; Under full load (unshare() in loop -&gt; OOM conditions) we can
&gt; get kernel panic:
&gt;
&gt; BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
&gt; IP: [&lt;ffffffff81476c85&gt;] nfqnl_nf_hook_drop+0x35/0x70
&gt; [..]
&gt; task: ffff88012dfa3840 ti: ffff88012dffc000 task.ti: ffff88012dffc000
&gt; RIP: 0010:[&lt;ffffffff81476c85&gt;]  [&lt;ffffffff81476c85&gt;] nfqnl_nf_hook_drop+0x35/0x70
&gt; RSP: 0000:ffff88012dfffd80  EFLAGS: 00010206
&gt; RAX: 0000000000000008 RBX: ffffffff81add0c0 RCX: ffff88013fd80000
&gt; [..]
&gt; Call Trace:
&gt;  [&lt;ffffffff81474d98&gt;] nf_queue_nf_hook_drop+0x18/0x20
&gt;  [&lt;ffffffff814738eb&gt;] nf_unregister_net_hook+0xdb/0x150
&gt;  [&lt;ffffffff8147398f&gt;] netfilter_net_exit+0x2f/0x60
&gt;  [&lt;ffffffff8141b088&gt;] ops_exit_list.isra.4+0x38/0x60
&gt;  [&lt;ffffffff8141b652&gt;] setup_net+0xc2/0x120
&gt;  [&lt;ffffffff8141bd09&gt;] copy_net_ns+0x79/0x120
&gt;  [&lt;ffffffff8106965b&gt;] create_new_namespaces+0x11b/0x1e0
&gt;  [&lt;ffffffff810698a7&gt;] unshare_nsproxy_namespaces+0x57/0xa0
&gt;  [&lt;ffffffff8104baa2&gt;] SyS_unshare+0x1b2/0x340
&gt;  [&lt;ffffffff81608276&gt;] entry_SYSCALL_64_fastpath+0x1e/0xa8
&gt; Code: 65 00 48 89 e5 41 56 41 55 41 54 53 83 e8 01 48 8b 97 70 12 00 00 48 98 49 89 f4 4c 8b 74 c2 18 4d 8d 6e 08 49 81 c6 88 00 00 00 &lt;49&gt; 8b 5d 00 48 85 db 74 1a 48 89 df 4c 89 e2 48 c7 c6 90 68 47
&gt;

The simple fix for this requires a new pernet variable for struct
nf_queue that indicates when it is safe to use the dynamically
allocated nf_queue state.

As we need a variable anyway make nf_register_queue_handler and
nf_unregister_queue_handler pernet.  This allows the existing logic of
when it is safe to use the state from the nfnetlink_queue module to be
reused with no changes except for making it per net.

The syncrhonize_rcu from nf_unregister_queue_handler is moved to a new
function nfnl_queue_net_exit_batch so that the worst case of having a
syncrhonize_rcu in the pernet exit path is not experienced in batch
mode.

Reported-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Acked-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: use a single expectation table for all namespaces</title>
<updated>2016-05-06T09:50:01Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2016-05-05T22:51:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0a93aaedc46af2c5feecfb1066d98bfb491ec0b8'/>
<id>urn:sha1:0a93aaedc46af2c5feecfb1066d98bfb491ec0b8</id>
<content type='text'>
We already include netns address in the hash and compare the netns pointers
during lookup, so even if namespaces have overlapping addresses entries
will be spread across the expectation table.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_tables: allow set names up to 32 bytes</title>
<updated>2016-05-05T14:39:51Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2016-05-04T15:49:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cb39ad8b8ef224c544074962780bf763077d6141'/>
<id>urn:sha1:cb39ad8b8ef224c544074962780bf763077d6141</id>
<content type='text'>
Currently, we support set names of up to 16 bytes, get this aligned
with the maximum length we can use in ipset to make it easier when
considering migration to nf_tables.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: introduce clash resolution on insertion race</title>
<updated>2016-05-05T14:39:50Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2016-04-30T22:28:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=71d8c47fc653711c41bc3282e5b0e605b3727956'/>
<id>urn:sha1:71d8c47fc653711c41bc3282e5b0e605b3727956</id>
<content type='text'>
This patch introduces nf_ct_resolve_clash() to resolve race condition on
conntrack insertions.

This is particularly a problem for connection-less protocols such as
UDP, with no initial handshake. Two or more packets may race to insert
the entry resulting in packet drops.

Another problematic scenario are packets enqueued to userspace via
NFQUEUE after the raw table, that make it easier to trigger this
race.

To resolve this, the idea is to reset the conntrack entry to the one
that won race. Packet and bytes counters are also merged.

The 'insert_failed' stats still accounts for this situation, after
this patch, the drop counter is bumped whenever we drop packets, so we
can watch for unresolved clashes.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: use a single hashtable for all namespaces</title>
<updated>2016-05-05T14:39:47Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2016-05-02T16:39:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=56d52d4892d0e478a005b99ed10d0a7f488ea8c1'/>
<id>urn:sha1:56d52d4892d0e478a005b99ed10d0a7f488ea8c1</id>
<content type='text'>
We already include netns address in the hash and compare the netns pointers
during lookup, so even if namespaces have overlapping addresses entries
will be spread across the table.

Assuming 64k bucket size, this change saves 0.5 mbyte per namespace on a
64bit system.

NAT bysrc and expectation hash is still per namespace, those will
changed too soon.

Future patch will also make conntrack object slab cache global again.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: use get_random_once for conntrack hash seed</title>
<updated>2016-04-25T12:52:12Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2016-04-18T14:17:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=141658fb02c248e6243d619cb7d48a76158a66ac'/>
<id>urn:sha1:141658fb02c248e6243d619cb7d48a76158a66ac</id>
<content type='text'>
As earlier commit removed accessed to the hash from other files we can
also make it static.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: connlabels: change nf_connlabels_get bit arg to 'highest used'</title>
<updated>2016-04-18T18:39:48Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2016-04-12T16:14:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=adff6c65600000ec2bb71840c943ee12668080f5'/>
<id>urn:sha1: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>
</entry>
</feed>
