<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/netfilter, branch v4.4</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.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-12-18T13:45:45Z</updated>
<entry>
<title>netfilter: nft_ct: include direction when dumping NFT_CT_L3PROTOCOL key</title>
<updated>2015-12-18T13:45:45Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2015-12-18T13:32:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5f79b6e4d169039903cc869e16e59ad861dd479'/>
<id>urn:sha1:d5f79b6e4d169039903cc869e16e59ad861dd479</id>
<content type='text'>
one nft userspace test case fails with

'ct l3proto original ipv4' mismatches 'ct l3proto ipv4'

... because NFTA_CT_DIRECTION attr is missing.

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: use skb-&gt;protocol instead of assuming ethernet header</title>
<updated>2015-12-18T13:45:45Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2015-12-15T20:29:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa47e42c60dfa31f81a3fe357451acfe1a12ca1e'/>
<id>urn:sha1:aa47e42c60dfa31f81a3fe357451acfe1a12ca1e</id>
<content type='text'>
Otherwise we may end up with incorrect network and transport header for
other protocols.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_tables: use reverse traversal commit_list in nf_tables_abort</title>
<updated>2015-12-13T21:47:32Z</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2015-12-07T10:48:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a907e36d54e0ff836e55e04531be201bf6b4d8c8'/>
<id>urn:sha1:a907e36d54e0ff836e55e04531be201bf6b4d8c8</id>
<content type='text'>
When we use 'nft -f' to submit rules, it will build multiple rules into
one netlink skb to send to kernel, kernel will process them one by one.
meanwhile, it add the trans into commit_list to record every commit.
if one of them's return value is -EAGAIN, status |= NFNL_BATCH_REPLAY
will be marked. after all the process is done. it will roll back all the
commits.

now kernel use list_add_tail to add trans to commit, and use
list_for_each_entry_safe to roll back. which means the order of adding
and rollback is the same. that will cause some cases cannot work well,
even trigger call trace, like:

1. add a set into table foo  [return -EAGAIN]:
   commit_list = 'add set trans'
2. del foo:
   commit_list = 'add set trans' -&gt; 'del set trans' -&gt; 'del tab trans'
then nf_tables_abort will be called to roll back:
firstly process 'add set trans':
                   case NFT_MSG_NEWSET:
                        trans-&gt;ctx.table-&gt;use--;
                        list_del_rcu(&amp;nft_trans_set(trans)-&gt;list);

  it will del the set from the table foo, but it has removed when del
  table foo [step 2], then the kernel will panic.

the right order of rollback should be:
  'del tab trans' -&gt; 'del set trans' -&gt; 'add set trans'.
which is opposite with commit_list order.

so fix it by rolling back commits with reverse order in nf_tables_abort.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nfnetlink: fix splat due to incorrect socket memory accounting in skbuff clones</title>
<updated>2015-12-10T17:16:29Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2015-12-09T11:09:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bd678e09dc1797bc0e2e536b6b268e7cf46e0184'/>
<id>urn:sha1:bd678e09dc1797bc0e2e536b6b268e7cf46e0184</id>
<content type='text'>
If we attach the sk to the skb from nfnetlink_rcv_batch(), then
netlink_skb_destructor() will underflow the socket receive memory
counter and we get warning splat when releasing the socket.

$ cat /proc/net/netlink
sk       Eth Pid    Groups   Rmem     Wmem     Dump     Locks     Drops     Inode
ffff8800ca903000 12  0      00000000 -54144   0        0 2        0        17942
                                     ^^^^^^

Rmem above shows an underflow.

And here below the warning splat:

[ 1363.815976] WARNING: CPU: 2 PID: 1356 at net/netlink/af_netlink.c:958 netlink_sock_destruct+0x80/0xb9()
[...]
[ 1363.816152] CPU: 2 PID: 1356 Comm: kworker/u16:1 Tainted: G        W       4.4.0-rc1+ #153
[ 1363.816155] Hardware name: LENOVO 23259H1/23259H1, BIOS G2ET32WW (1.12 ) 05/30/2012
[ 1363.816160] Workqueue: netns cleanup_net
[ 1363.816163]  0000000000000000 ffff880119203dd0 ffffffff81240204 0000000000000000
[ 1363.816169]  ffff880119203e08 ffffffff8104db4b ffffffff813d49a1 ffff8800ca771000
[ 1363.816174]  ffffffff81a42b00 0000000000000000 ffff8800c0afe1e0 ffff880119203e18
[ 1363.816179] Call Trace:
[ 1363.816181]  &lt;IRQ&gt;  [&lt;ffffffff81240204&gt;] dump_stack+0x4e/0x79
[ 1363.816193]  [&lt;ffffffff8104db4b&gt;] warn_slowpath_common+0x9a/0xb3
[ 1363.816197]  [&lt;ffffffff813d49a1&gt;] ? netlink_sock_destruct+0x80/0xb9

skb-&gt;sk was only needed to lookup for the netns, however we don't need
this anymore since 633c9a840d0b ("netfilter: nfnetlink: avoid recurrent
netns lookups in call_batch") so this patch removes this manual socket
assignment to resolve this problem.

Reported-by: Arturo Borrero Gonzalez &lt;arturo.borrero.glez@gmail.com&gt;
Reported-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Tested-by: Arturo Borrero Gonzalez &lt;arturo.borrero.glez@gmail.com&gt;
</content>
</entry>
<entry>
<title>netfilter: nfnetlink: avoid recurrent netns lookups in call_batch</title>
<updated>2015-12-10T12:49:24Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2015-12-09T11:08:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=633c9a840d0bf1cce690f3165bdacd8ab412949e'/>
<id>urn:sha1:633c9a840d0bf1cce690f3165bdacd8ab412949e</id>
<content type='text'>
Pass the net pointer to the call_batch callback functions so we can skip
recurrent lookups.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Tested-by: Arturo Borrero Gonzalez &lt;arturo.borrero.glez@gmail.com&gt;
</content>
</entry>
<entry>
<title>netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure</title>
<updated>2015-12-09T13:46:47Z</updated>
<author>
<name>Nikolay Borisov</name>
<email>kernel@kyup.com</email>
</author>
<published>2015-12-07T10:13:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=639e077b43d9c54ffb1e1b54a2de54597ceae1d8'/>
<id>urn:sha1:639e077b43d9c54ffb1e1b54a2de54597ceae1d8</id>
<content type='text'>
Commit 3bfe049807c2403 ("netfilter: nfnetlink_{log,queue}:
Register pernet in first place") reorganised the initialisation
order of the pernet_subsys to avoid "use-before-initialised"
condition. However, in doing so the cleanup logic in nfnetlink_queue
got botched in that the pernet_subsys wasn't cleaned in case
nfnetlink_subsys_register failed. This patch adds the necessary
cleanup routine call.

Fixes: 3bfe049807c2403 ("netfilter: nfnetlink_{log,queue}: Register pernet in first place")
Signed-off-by: Nikolay Borisov &lt;kernel@kyup.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nfnetlink_queue: avoid harmless unnitialized variable warnings</title>
<updated>2015-11-23T10:22:26Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2015-11-19T12:49:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e662164abb4a8fde701a46e1431980f9e325742'/>
<id>urn:sha1:8e662164abb4a8fde701a46e1431980f9e325742</id>
<content type='text'>
Several ARM default configurations give us warnings on recent
compilers about potentially uninitialized variables in the
nfnetlink code in two functions:

net/netfilter/nfnetlink_queue.c: In function 'nfqnl_build_packet_message':
net/netfilter/nfnetlink_queue.c:519:19: warning: 'nfnl_ct' may be used uninitialized in this function [-Wmaybe-uninitialized]
  if (ct &amp;&amp; nfnl_ct-&gt;build(skb, ct, ctinfo, NFQA_CT, NFQA_CT_INFO) &lt; 0)

Moving the rcu_dereference(nfnl_ct_hook) call outside of the
conditional code avoids the warning without forcing us to
preinitialize the variable.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: a4b4766c3ceb ("netfilter: nfnetlink_queue: rename related to nfqueue attaching conntrack info")
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>ipvs: use skb_to_full_sk() helper</title>
<updated>2015-11-15T23:39:48Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-11-12T17:14:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=340c78e5906264c42f9415005c7ba0a4efcfe735'/>
<id>urn:sha1:340c78e5906264c42f9415005c7ba0a4efcfe735</id>
<content type='text'>
SYNACK packets might be attached to request sockets.

Use skb_to_full_sk() helper to avoid illegal accesses to
inet_sk(skb-&gt;sk)

Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead of listener")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Sander Eikelenboom &lt;linux@eikelenboom.it&gt;
Acked-by: Julian Anastasov &lt;ja@ssi.bg&gt;
Acked-by: Simon Horman &lt;horms@verge.net.au&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf</title>
<updated>2015-11-12T19:17:16Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-11-12T19:17:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=382a483e53fa9a84579aa92701d54801b37fb8fd'/>
<id>urn:sha1:382a483e53fa9a84579aa92701d54801b37fb8fd</id>
<content type='text'>
Pablo Neira Ayuso:

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

The following patchset contains Netfilter fixes for your net tree. This
large batch that includes fixes for ipset, netfilter ingress, nf_tables
dynamic set instantiation and a longstanding Kconfig dependency problem.
More specifically, they are:

1) Add missing check for empty hook list at the ingress hook, from
   Florian Westphal.

2) Input and output interface are swapped at the ingress hook,
   reported by Patrick McHardy.

3) Resolve ipset extension alignment issues on ARM, patch from Jozsef
   Kadlecsik.

4) Fix bit check on bitmap in ipset hash type, also from Jozsef.

5) Release buckets when all entries have expired in ipset hash type,
   again from Jozsef.

6) Oneliner to initialize conntrack tuple object in the PPTP helper,
   otherwise the conntrack lookup may fail due to random bits in the
   structure holes, patch from Anthony Lineham.

7) Silence a bogus gcc warning in nfnetlink_log, from Arnd Bergmann.

8) Fix Kconfig dependency problems with TPROXY, socket and dup, also
   from Arnd.

9) Add __netdev_alloc_pcpu_stats() to allow creating percpu counters
   from atomic context, this is required by the follow up fix for
   nf_tables.

10) Fix crash from the dynamic set expression, we have to add new clone
    operation that should be defined when a simple memcpy is not enough.
    This resolves a crash when using per-cpu counters with new Patrick
    McHardy's flow table nft support.
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_tables: add clone interface to expression operations</title>
<updated>2015-11-10T22:47:32Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2015-11-10T12:39:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=086f332167d64b645d37405854f049b9ad7371ab'/>
<id>urn:sha1:086f332167d64b645d37405854f049b9ad7371ab</id>
<content type='text'>
With the conversion of the counter expressions to make it percpu, we
need to clone the percpu memory area, otherwise we crash when using
counters from flow tables.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
</feed>
