<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/netfilter, branch mybooklive</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/net/netfilter?h=mybooklive</id>
<link rel='self' href='https://git.amat.us/linux/atom/net/netfilter?h=mybooklive'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-08-13T23:11:53Z</updated>
<entry>
<title>gpl-source-mybooklive-020202.zip</title>
<updated>2014-08-13T23:11:53Z</updated>
<author>
<name>David Barksdale</name>
<email>amatus@amatus.name</email>
</author>
<published>2014-08-13T23:11:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3918522a523adc3f001cf9c5da327d8fb383c26e'/>
<id>urn:sha1:3918522a523adc3f001cf9c5da327d8fb383c26e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>gpl-source-mybooklive-020035.zip</title>
<updated>2014-08-13T23:04:11Z</updated>
<author>
<name>David Barksdale</name>
<email>amatus@amatus.name</email>
</author>
<published>2014-08-13T23:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f05c100b6a7051106229cda5a845e94e36e71b17'/>
<id>urn:sha1:f05c100b6a7051106229cda5a845e94e36e71b17</id>
<content type='text'>
</content>
</entry>
<entry>
<title>netfilter: xt_recent: fix regression in rules using a zero hit_count</title>
<updated>2010-04-01T22:58:47Z</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2010-03-22T17:25:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5a32ab6f23dd07b97a6095d6ddbfa79c47cf3bbd'/>
<id>urn:sha1:5a32ab6f23dd07b97a6095d6ddbfa79c47cf3bbd</id>
<content type='text'>
commit ef1691504c83ba3eb636c0cfd3ed33f7a6d0b4ee upstream.

Commit 8ccb92ad (netfilter: xt_recent: fix false match) fixed supposedly
false matches in rules using a zero hit_count. As it turns out there is
nothing false about these matches and people are actually using entries
with a hit_count of zero to make rules dependant on addresses inserted
manually through /proc.

Since this slipped past the eyes of three reviewers, instead of
reverting the commit in question, this patch explicitly checks
for a hit_count of zero to make the intentions more clear.

Reported-by: Thomas Jarosch &lt;thomas.jarosch@intra2net.com&gt;
Tested-by: Thomas Jarosch &lt;thomas.jarosch@intra2net.com&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>netfilter: xt_recent: fix false match</title>
<updated>2010-03-15T15:50:01Z</updated>
<author>
<name>Tim Gardner</name>
<email>tim.gardner@canonical.com</email>
</author>
<published>2010-02-23T13:59:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=58368fc8325ee2a9af4c29e232e319d78903f64b'/>
<id>urn:sha1:58368fc8325ee2a9af4c29e232e319d78903f64b</id>
<content type='text'>
commit 8ccb92ad41cb311e52ad1b1fe77992c7f47a3b63 upstream.

A rule with a zero hit_count will always match.

Signed-off-by: Tim Gardner &lt;tim.gardner@canonical.com&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>netfilter: xt_recent: fix buffer overflow</title>
<updated>2010-03-15T15:50:00Z</updated>
<author>
<name>Tim Gardner</name>
<email>tim.gardner@canonical.com</email>
</author>
<published>2010-02-23T13:55:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6f2deb6aad5e242d5573ae8d98a90a454f5e79d0'/>
<id>urn:sha1:6f2deb6aad5e242d5573ae8d98a90a454f5e79d0</id>
<content type='text'>
commit 2c08522e5d2f0af2d6f05be558946dcbf8173683 upstream.

e-&gt;index overflows e-&gt;stamps[] every ip_pkt_list_tot packets.

Consider the case when ip_pkt_list_tot==1; the first packet received is stored
in e-&gt;stamps[0] and e-&gt;index is initialized to 1. The next received packet
timestamp is then stored at e-&gt;stamps[1] in recent_entry_update(),
a buffer overflow because the maximum e-&gt;stamps[] index is 0.

Signed-off-by: Tim Gardner &lt;tim.gardner@canonical.com&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>netfilter: nf_conntrack: fix hash resizing with namespaces</title>
<updated>2010-02-23T15:37:53Z</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2010-02-08T19:18:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=242a71829e57a4962e43f89cf50d5fa99ff8a3e5'/>
<id>urn:sha1:242a71829e57a4962e43f89cf50d5fa99ff8a3e5</id>
<content type='text'>
commit d696c7bdaa55e2208e56c6f98e6bc1599f34286d upstream.

As noticed by Jon Masters &lt;jonathan@jonmasters.org&gt;, the conntrack hash
size is global and not per namespace, but modifiable at runtime through
/sys/module/nf_conntrack/hashsize. Changing the hash size will only
resize the hash in the current namespace however, so other namespaces
will use an invalid hash size. This can cause crashes when enlarging
the hashsize, or false negative lookups when shrinking it.

Move the hash size into the per-namespace data and only use the global
hash size to initialize the per-namespace value when instanciating a
new namespace. Additionally restrict hash resizing to init_net for
now as other namespaces are not handled currently.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>netfilter: nf_conntrack: restrict runtime expect hashsize modifications</title>
<updated>2010-02-23T15:37:53Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2010-02-08T19:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=51d3a347944f76bc2f304e0622d61b9b39fec585'/>
<id>urn:sha1:51d3a347944f76bc2f304e0622d61b9b39fec585</id>
<content type='text'>
commit 13ccdfc2af03e09e60791f7d4bc4ccf53398af7c upstream.

Expectation hashtable size was simply glued to a variable with no code
to rehash expectations, so it was a bug to allow writing to it.
Make "expect_hashsize" readonly.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>netfilter: nf_conntrack: per netns nf_conntrack_cachep</title>
<updated>2010-02-23T15:37:53Z</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2010-02-08T19:16:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=747edef00c9b2147ca0b3d5bc33e9291a9a6d86e'/>
<id>urn:sha1:747edef00c9b2147ca0b3d5bc33e9291a9a6d86e</id>
<content type='text'>
commit 5b3501faa8741d50617ce4191c20061c6ef36cb3 upstream.

nf_conntrack_cachep is currently shared by all netns instances, but
because of SLAB_DESTROY_BY_RCU special semantics, this is wrong.

If we use a shared slab cache, one object can instantly flight between
one hash table (netns ONE) to another one (netns TWO), and concurrent
reader (doing a lookup in netns ONE, 'finding' an object of netns TWO)
can be fooled without notice, because no RCU grace period has to be
observed between object freeing and its reuse.

We dont have this problem with UDP/TCP slab caches because TCP/UDP
hashtables are global to the machine (and each object has a pointer to
its netns).

If we use per netns conntrack hash tables, we also *must* use per netns
conntrack slab caches, to guarantee an object can not escape from one
namespace to another one.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
[Patrick: added unique slab name allocation]
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>netfilter: nf_conntrack: fix memory corruption with multiple namespaces</title>
<updated>2010-02-23T15:37:53Z</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2010-02-08T19:16:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=de2545859df3c04462ef39bf8056e587a1d2fa17'/>
<id>urn:sha1:de2545859df3c04462ef39bf8056e587a1d2fa17</id>
<content type='text'>
commit 9edd7ca0a3e3999c260642c92fa008892d82ca6e upstream.

As discovered by Jon Masters &lt;jonathan@jonmasters.org&gt;, the "untracked"
conntrack, which is located in the data section, might be accidentally
freed when a new namespace is instantiated while the untracked conntrack
is attached to a skb because the reference count it re-initialized.

The best fix would be to use a seperate untracked conntrack per
namespace since it includes a namespace pointer. Unfortunately this is
not possible without larger changes since the namespace is not easily
available everywhere we need it. For now move the untracked conntrack
initialization to the init_net setup function to make sure the reference
count is not re-initialized and handle cleanup in the init_net cleanup
function to make sure namespaces can exit properly while the untracked
conntrack is in use in other namespaces.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>netfilter: xtables: fix conntrack match v1 ipt-save output</title>
<updated>2010-01-28T23:01:04Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2009-11-23T09:43:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8f2fefcddff63394e42a6165040945cc9967bd19'/>
<id>urn:sha1:8f2fefcddff63394e42a6165040945cc9967bd19</id>
<content type='text'>
commit 3a0429292daa0e1ec848bd26479f5e48b0d54a42 upstream.

commit d6d3f08b0fd998b647a05540cedd11a067b72867
(netfilter: xtables: conntrack match revision 2) does break the
v1 conntrack match iptables-save output in a subtle way.

Problem is as follows:

    up = kmalloc(sizeof(*up), GFP_KERNEL);
[..]
   /*
    * The strategy here is to minimize the overhead of v1 matching,
    * by prebuilding a v2 struct and putting the pointer into the
    * v1 dataspace.
    */
    memcpy(up, info, offsetof(typeof(*info), state_mask));
[..]
    *(void **)info  = up;

As the v2 struct pointer is saved in the match data space,
it clobbers the first structure member (-&gt;origsrc_addr).

Because the _v1 match function grabs this pointer and does not actually
look at the v1 origsrc, run time functionality does not break.
But iptables -nvL (or iptables-save) cannot know that v1 origsrc_addr
has been overloaded in this way:

$ iptables -p tcp -A OUTPUT -m conntrack --ctorigsrc 10.0.0.1 -j ACCEPT
$ iptables-save
-A OUTPUT -p tcp -m conntrack --ctorigsrc 128.173.134.206 -j ACCEPT

(128.173... is the address to the v2 match structure).

To fix this, we take advantage of the fact that the v1 and v2 structures
are identical with exception of the last two structure members (u8 in v1,
u16 in v2).

We extract them as early as possible and prevent the v2 matching function
from looking at those two members directly.

Previously reported by Michel Messerschmidt via Ben Hutchings, also
see Debian Bug tracker #556587.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
</feed>
