<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/net/pkt_cls.h, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2014-10-06T22:02:32Z</updated>
<entry>
<title>net: sched: remove tcf_proto from ematch calls</title>
<updated>2014-10-06T22:02:32Z</updated>
<author>
<name>John Fastabend</name>
<email>john.fastabend@gmail.com</email>
</author>
<published>2014-10-06T04:27:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=82a470f1119eb7d2e4941b915bf9cd6fd8d54494'/>
<id>urn:sha1:82a470f1119eb7d2e4941b915bf9cd6fd8d54494</id>
<content type='text'>
This removes the tcf_proto argument from the ematch code paths that
only need it to reference the net namespace. This allows simplifying
qdisc code paths especially when we need to tear down the ematch
from an RCU callback. In this case we can not guarentee that the
tcf_proto structure is still valid.

Signed-off-by: John Fastabend &lt;john.r.fastabend@intel.com&gt;
Acked-by: Cong Wang &lt;cwang@twopensource.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net_sched: avoid calling tcf_unbind_filter() in call_rcu callback</title>
<updated>2014-10-02T02:00:42Z</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2014-09-30T23:07:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a0efb80ce3abacfd22a4284c3730924fc2f1f077'/>
<id>urn:sha1:a0efb80ce3abacfd22a4284c3730924fc2f1f077</id>
<content type='text'>
This fixes the following crash:

[   63.976822] general protection fault: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[   63.980094] CPU: 1 PID: 15 Comm: ksoftirqd/1 Not tainted 3.17.0-rc6+ #648
[   63.980094] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[   63.980094] task: ffff880117dea690 ti: ffff880117dfc000 task.ti: ffff880117dfc000
[   63.980094] RIP: 0010:[&lt;ffffffff817e6d07&gt;]  [&lt;ffffffff817e6d07&gt;] u32_destroy_key+0x27/0x6d
[   63.980094] RSP: 0018:ffff880117dffcc0  EFLAGS: 00010202
[   63.980094] RAX: ffff880117dea690 RBX: ffff8800d02e0820 RCX: 0000000000000000
[   63.980094] RDX: 0000000000000001 RSI: 0000000000000002 RDI: 6b6b6b6b6b6b6b6b
[   63.980094] RBP: ffff880117dffcd0 R08: 0000000000000000 R09: 0000000000000000
[   63.980094] R10: 00006c0900006ba8 R11: 00006ba100006b9d R12: 0000000000000001
[   63.980094] R13: ffff8800d02e0898 R14: ffffffff817e6d4d R15: ffff880117387a30
[   63.980094] FS:  0000000000000000(0000) GS:ffff88011a800000(0000) knlGS:0000000000000000
[   63.980094] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   63.980094] CR2: 00007f07e6732fed CR3: 000000011665b000 CR4: 00000000000006e0
[   63.980094] Stack:
[   63.980094]  ffff88011a9cd300 ffffffff82051ac0 ffff880117dffce0 ffffffff817e6d68
[   63.980094]  ffff880117dffd70 ffffffff810cb4c7 ffffffff810cb3cd ffff880117dfffd8
[   63.980094]  ffff880117dea690 ffff880117dea690 ffff880117dfffd8 000000000000000a
[   63.980094] Call Trace:
[   63.980094]  [&lt;ffffffff817e6d68&gt;] u32_delete_key_freepf_rcu+0x1b/0x1d
[   63.980094]  [&lt;ffffffff810cb4c7&gt;] rcu_process_callbacks+0x3bb/0x691
[   63.980094]  [&lt;ffffffff810cb3cd&gt;] ? rcu_process_callbacks+0x2c1/0x691
[   63.980094]  [&lt;ffffffff817e6d4d&gt;] ? u32_destroy_key+0x6d/0x6d
[   63.980094]  [&lt;ffffffff810780a4&gt;] __do_softirq+0x142/0x323
[   63.980094]  [&lt;ffffffff810782a8&gt;] run_ksoftirqd+0x23/0x53
[   63.980094]  [&lt;ffffffff81092126&gt;] smpboot_thread_fn+0x203/0x221
[   63.980094]  [&lt;ffffffff81091f23&gt;] ? smpboot_unpark_thread+0x33/0x33
[   63.980094]  [&lt;ffffffff8108e44d&gt;] kthread+0xc9/0xd1
[   63.980094]  [&lt;ffffffff819e00ea&gt;] ? do_wait_for_common+0xf8/0x125
[   63.980094]  [&lt;ffffffff8108e384&gt;] ? __kthread_parkme+0x61/0x61
[   63.980094]  [&lt;ffffffff819e43ec&gt;] ret_from_fork+0x7c/0xb0
[   63.980094]  [&lt;ffffffff8108e384&gt;] ? __kthread_parkme+0x61/0x61

tp could be freed in call_rcu callback too, the order is not guaranteed.

John Fastabend says:

====================
Its worth noting why this is safe. Any running schedulers will either
read the valid class field or it will be zeroed.

All schedulers today when the class is 0 do a lookup using the
same call used by the tcf_exts_bind(). So even if we have a running
classifier hit the null class pointer it will do a lookup and get
to the same result. This is particularly fragile at the moment because
the only way to verify this is to audit the schedulers call sites.
====================

Cc: John Fastabend &lt;john.r.fastabend@intel.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Acked-by: John Fastabend &lt;john.r.fastabend@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net_sched: remove the first parameter from tcf_exts_destroy()</title>
<updated>2014-09-28T21:29:01Z</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2014-09-25T17:26:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=18d0264f630e200772bf236ac5747c47e908501e'/>
<id>urn:sha1:18d0264f630e200772bf236ac5747c47e908501e</id>
<content type='text'>
Cc: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Acked-by: Jamal Hadi Salim &lt;hadi@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sched, cls: check if we could overwrite actions when changing a filter</title>
<updated>2014-04-28T03:42:39Z</updated>
<author>
<name>Cong Wang</name>
<email>cwang@twopensource.com</email>
</author>
<published>2014-04-25T20:54:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2f7ef2f8790f5bf53db4fc6b2310943139285827'/>
<id>urn:sha1:2f7ef2f8790f5bf53db4fc6b2310943139285827</id>
<content type='text'>
When actions are attached to a filter, they are a part of the filter
itself, so when changing a filter we should allow to overwrite the actions
inside as well.

In my specific case, when I tried to _append_ a new action to an existing
filter which already has an action, I got EEXIST since kernel refused
to overwrite the existing one in kernel.

This patch checks if we are changing the filter checking NLM_F_CREATE flag
(Sigh, filters don't use NLM_F_REPLACE...) and then passes the boolean down
to actions. This fixes the problem above.

Cc: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: Cong Wang &lt;cwang@twopensource.com&gt;
Signed-off-by: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net_sched: optimize tcf_match_indev()</title>
<updated>2014-01-13T19:50:15Z</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2014-01-10T00:14:02Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2519a602c273c5254781bc55b6e678a17e469a12'/>
<id>urn:sha1:2519a602c273c5254781bc55b6e678a17e469a12</id>
<content type='text'>
tcf_match_indev() is called in fast path, it is not wise to
search for a netdev by ifindex and then compare by its name,
just compare the ifindex.

Also, dev-&gt;name could be changed by user-space, therefore
the match would be always fail, but dev-&gt;ifindex could
be consistent.

BTW, this will also save some bytes from the core struct of u32.

Cc: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net_sched: cls: refactor out struct tcf_ext_map</title>
<updated>2013-12-18T17:52:07Z</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2013-12-16T04:15:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5da57f422d89c504a1d72dadd4e19d3dca8e974e'/>
<id>urn:sha1:5da57f422d89c504a1d72dadd4e19d3dca8e974e</id>
<content type='text'>
These information can be saved in tcf_exts, and this will
simplify the code.

Cc: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net_sched: act: use standard struct list_head</title>
<updated>2013-12-18T17:52:07Z</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2013-12-16T04:15:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=33be627159913b094bb578e83e9a7fdc66c10208'/>
<id>urn:sha1:33be627159913b094bb578e83e9a7fdc66c10208</id>
<content type='text'>
Currently actions are chained by a singly linked list,
therefore it is a bit hard to add and remove a specific
entry. Convert it to struct list_head so that in the
latter patch we can remove an action without finding
its head.

Cc: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Remove extern from include/net/ scheduling prototypes</title>
<updated>2013-08-01T00:24:22Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2013-07-31T05:47:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5c15257f93234aaa9775291a041b49eeb38fd95a'/>
<id>urn:sha1:5c15257f93234aaa9775291a041b49eeb38fd95a</id>
<content type='text'>
There are a mix of function prototypes with and without extern
in the kernel sources.  Standardize on not using extern for
function prototypes.

Function prototypes don't need to be written with extern.
extern is assumed by the compiler.  Its use is as unnecessary as
using auto to declare automatic/local variables in a block.

Reflow modified prototypes to 80 columns.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>pkt_sched: namespace aware act_mirred</title>
<updated>2013-01-14T20:09:36Z</updated>
<author>
<name>Benjamin LaHaise</name>
<email>bcrl@kvack.org</email>
</author>
<published>2013-01-14T05:15:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c1b52739e45f5969b208ebc377f52468280af11e'/>
<id>urn:sha1:c1b52739e45f5969b208ebc377f52468280af11e</id>
<content type='text'>
Eric Dumazet pointed out that act_mirred needs to find the current net_ns,
and struct net pointer is not provided in the call chain.  His original
patch made use of current-&gt;nsproxy-&gt;net_ns to find the network namespace,
but this fails to work correctly for userspace code that makes use of
netlink sockets in different network namespaces.  Instead, pass the
"struct net *" down along the call chain to where it is needed.

This version removes the ifb changes as Eric has submitted that patch
separately, but is otherwise identical to the previous version.

Signed-off-by: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Tested-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Acked-by: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Fix range checks in tcf_valid_offset().</title>
<updated>2010-12-21T20:43:16Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2010-12-21T20:43:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=da521b2c4f046383bc8941604174bc0e8bffb430'/>
<id>urn:sha1:da521b2c4f046383bc8941604174bc0e8bffb430</id>
<content type='text'>
This function has three bugs:

1) The offset should be valid most of the time, this is just
   a sanity check, therefore we should use "likely" not "unlikely"

2) This is the only place where we can check for arithmetic overflow
   of the pointer plus the length.

3) The existing range checks are off by one, the valid range is
   skb-&gt;head to skb_tail_pointer(), inclusive.

Based almost entirely upon a patch by Ralph Loader.

Reported-by: Ralph Loader &lt;suckfish@ihug.co.nz&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
