2012-10-01 12:32:35 +00:00
|
|
|
|
2012-11-13 13:29:15 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-04-27 11:31:52 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:29 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-01-29 23:43:07 +00:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2014-07-13 19:49:42 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:07 -07:00
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
2014-09-16 17:31:18 -07:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-02 10:06:52 +08:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-27 11:31:53 +00:00
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:41 -07:00
|
|
|
|
2013-04-27 11:31:53 +00:00
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-20 00:26:31 -07:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2015-07-20 09:54:50 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-04-19 00:36:26 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:09 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:01 +02:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
2015-03-29 16:59:26 +02:00
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:59:26 +02:00
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
2015-03-29 16:59:25 +02:00
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
2015-03-29 16:59:25 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:59:26 +02:00
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:17:37 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-03-29 16:59:25 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-04 17:17:39 -07:00
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2013-08-04 17:17:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
|
|
|
|
|
2015-01-15 03:53:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
2014-11-13 14:43:08 -02:00
|
|
|
|
2015-08-20 13:56:28 +02:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:02 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2013-04-16 02:50:52 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:02 -07:00
|
|
|
|
2014-11-13 14:43:08 -02:00
|
|
|
|
2015-01-15 03:53:56 +01:00
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-15 03:53:56 +01:00
|
|
|
|
2013-08-19 11:23:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-04-19 00:36:26 +00:00
|
|
|
|
2014-07-26 00:38:59 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-01-20 15:15:47 +01:00
|
|
|
|
2015-01-26 14:10:53 +01:00
|
|
|
|
2015-05-07 11:02:49 +02:00
|
|
|
|
2015-01-20 15:15:47 +01:00
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
2013-04-16 02:50:52 +00:00
|
|
|
|
2013-06-20 00:26:31 -07:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-16 22:09:00 +01:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-04-27 11:31:54 +00:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
2015-01-26 14:10:53 +01:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-06-17 14:16:40 -07:00
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-09 20:35:47 +00:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-17 06:39:07 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hlist: drop the node parameter from iterators
I'm not sure why, but the hlist for each entry iterators were conceived
list_for_each_entry(pos, head, member)
The hlist ones were greedy and wanted an extra parameter:
hlist_for_each_entry(tpos, pos, head, member)
Why did they need an extra pos parameter? I'm not quite sure. Not only
they don't really need it, it also prevents the iterator from looking
exactly like the list iterator, which is unfortunate.
Besides the semantic patch, there was some manual work required:
- Fix up the actual hlist iterators in linux/list.h
- Fix up the declaration of other iterators based on the hlist ones.
- A very small amount of places were using the 'node' parameter, this
was modified to use 'obj->member' instead.
- Coccinelle didn't handle the hlist_for_each_entry_safe iterator
properly, so those had to be fixed up manually.
The semantic patch which is mostly the work of Peter Senna Tschudin is here:
@@
iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;
type T;
expression a,c,d,e;
identifier b;
statement S;
@@
-T b;
<+... when != b
(
hlist_for_each_entry(a,
- b,
c, d) S
|
hlist_for_each_entry_continue(a,
- b,
c) S
|
hlist_for_each_entry_from(a,
- b,
c) S
|
hlist_for_each_entry_rcu(a,
- b,
c, d) S
|
hlist_for_each_entry_rcu_bh(a,
- b,
c, d) S
|
hlist_for_each_entry_continue_rcu_bh(a,
- b,
c) S
|
for_each_busy_worker(a, c,
- b,
d) S
|
ax25_uid_for_each(a,
- b,
c) S
|
ax25_for_each(a,
- b,
c) S
|
inet_bind_bucket_for_each(a,
- b,
c) S
|
sctp_for_each_hentry(a,
- b,
c) S
|
sk_for_each(a,
- b,
c) S
|
sk_for_each_rcu(a,
- b,
c) S
|
sk_for_each_from
-(a, b)
+(a)
S
+ sk_for_each_from(a) S
|
sk_for_each_safe(a,
- b,
c, d) S
|
sk_for_each_bound(a,
- b,
c) S
|
hlist_for_each_entry_safe(a,
- b,
c, d, e) S
|
hlist_for_each_entry_continue_rcu(a,
- b,
c) S
|
nr_neigh_for_each(a,
- b,
c) S
|
nr_neigh_for_each_safe(a,
- b,
c, d) S
|
nr_node_for_each(a,
- b,
c) S
|
nr_node_for_each_safe(a,
- b,
c, d) S
|
- for_each_gfn_sp(a, c, d, b) S
+ for_each_gfn_sp(a, c, d) S
|
- for_each_gfn_indirect_valid_sp(a, c, d, b) S
+ for_each_gfn_indirect_valid_sp(a, c, d) S
|
for_each_host(a,
- b,
c) S
|
for_each_host_safe(a,
- b,
c, d) S
|
for_each_mesh_entry(a,
- b,
c, d) S
)
...+>
[akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
[akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
[akpm@linux-foundation.org: checkpatch fixes]
[akpm@linux-foundation.org: fix warnings]
[akpm@linux-foudnation.org: redo intrusive kvm changes]
Tested-by: Peter Senna Tschudin <peter.senna@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-27 17:06:00 -08:00
|
|
|
|
drivers/net: Convert uses of compare_ether_addr to ether_addr_equal
Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.
Done via cocci script: (and a little typing)
$ cat compare_ether_addr.cocci
@@
expression a,b;
@@
- !compare_ether_addr(a, b)
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- compare_ether_addr(a, b)
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- !ether_addr_equal(a, b) == 0
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- !ether_addr_equal(a, b) != 0
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- ether_addr_equal(a, b) == 0
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- ether_addr_equal(a, b) != 0
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- !!ether_addr_equal(a, b)
+ ether_addr_equal(a, b)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-01 11:51:23 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-17 06:39:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:52 +03:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-06-25 16:01:52 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-06-25 16:01:52 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-19 17:20:07 +02:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-07-19 17:20:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-07-19 17:20:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2013-06-25 16:01:52 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-10 16:30:32 -08:00
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
2015-08-19 17:07:32 -07:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
2015-08-19 17:07:32 -07:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-19 17:07:32 -07:00
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-30 19:10:15 -08:00
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-10 16:30:27 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-10 16:30:32 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-19 17:07:32 -07:00
|
|
|
|
|
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
|
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-30 19:10:15 -08:00
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
|
|
|
|
|
2015-02-10 16:30:27 -08:00
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:37 -08:00
|
|
|
|
|
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
2014-11-10 11:45:13 -08:00
|
|
|
|
|
|
|
|
|
2014-12-30 19:10:15 -08:00
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
|
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
|
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
2015-08-20 13:56:28 +02:00
|
|
|
|
2013-09-13 07:34:13 -07:00
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
|
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
2015-08-20 13:56:28 +02:00
|
|
|
|
2013-09-13 07:34:13 -07:00
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2013-04-27 11:31:54 +00:00
|
|
|
|
2013-04-19 00:36:26 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-17 06:39:07 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 00:36:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-19 17:20:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-22 15:49:10 +08:00
|
|
|
|
2013-07-19 17:20:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2013-06-25 16:01:56 +03:00
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-07-19 17:20:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 00:36:26 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-11 19:00:35 +00:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:53 +03:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-06-25 16:01:53 +03:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-06-25 16:01:53 +03:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:53 +03:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:53 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2013-06-25 16:01:53 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-15 10:23:41 +08:00
|
|
|
|
2013-06-25 16:01:53 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-28 14:34:15 +01:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:53 +03:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-04-27 11:31:54 +00:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:53 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2014-04-01 09:23:01 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-04-27 11:31:54 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-13 12:00:18 +00:00
|
|
|
|
|
|
|
|
|
2014-11-28 14:34:15 +01:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:54 +03:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-06-25 16:01:54 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:54 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:54 +03:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-06-25 16:01:54 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
2013-08-17 07:32:09 +08:00
|
|
|
|
2013-06-25 16:01:54 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-10 07:01:58 -04:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hlist: drop the node parameter from iterators
I'm not sure why, but the hlist for each entry iterators were conceived
list_for_each_entry(pos, head, member)
The hlist ones were greedy and wanted an extra parameter:
hlist_for_each_entry(tpos, pos, head, member)
Why did they need an extra pos parameter? I'm not quite sure. Not only
they don't really need it, it also prevents the iterator from looking
exactly like the list iterator, which is unfortunate.
Besides the semantic patch, there was some manual work required:
- Fix up the actual hlist iterators in linux/list.h
- Fix up the declaration of other iterators based on the hlist ones.
- A very small amount of places were using the 'node' parameter, this
was modified to use 'obj->member' instead.
- Coccinelle didn't handle the hlist_for_each_entry_safe iterator
properly, so those had to be fixed up manually.
The semantic patch which is mostly the work of Peter Senna Tschudin is here:
@@
iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;
type T;
expression a,c,d,e;
identifier b;
statement S;
@@
-T b;
<+... when != b
(
hlist_for_each_entry(a,
- b,
c, d) S
|
hlist_for_each_entry_continue(a,
- b,
c) S
|
hlist_for_each_entry_from(a,
- b,
c) S
|
hlist_for_each_entry_rcu(a,
- b,
c, d) S
|
hlist_for_each_entry_rcu_bh(a,
- b,
c, d) S
|
hlist_for_each_entry_continue_rcu_bh(a,
- b,
c) S
|
for_each_busy_worker(a, c,
- b,
d) S
|
ax25_uid_for_each(a,
- b,
c) S
|
ax25_for_each(a,
- b,
c) S
|
inet_bind_bucket_for_each(a,
- b,
c) S
|
sctp_for_each_hentry(a,
- b,
c) S
|
sk_for_each(a,
- b,
c) S
|
sk_for_each_rcu(a,
- b,
c) S
|
sk_for_each_from
-(a, b)
+(a)
S
+ sk_for_each_from(a) S
|
sk_for_each_safe(a,
- b,
c, d) S
|
sk_for_each_bound(a,
- b,
c) S
|
hlist_for_each_entry_safe(a,
- b,
c, d, e) S
|
hlist_for_each_entry_continue_rcu(a,
- b,
c) S
|
nr_neigh_for_each(a,
- b,
c) S
|
nr_neigh_for_each_safe(a,
- b,
c, d) S
|
nr_node_for_each(a,
- b,
c) S
|
nr_node_for_each_safe(a,
- b,
c, d) S
|
- for_each_gfn_sp(a, c, d, b) S
+ for_each_gfn_sp(a, c, d) S
|
- for_each_gfn_indirect_valid_sp(a, c, d, b) S
+ for_each_gfn_indirect_valid_sp(a, c, d) S
|
for_each_host(a,
- b,
c) S
|
for_each_host_safe(a,
- b,
c, d) S
|
for_each_mesh_entry(a,
- b,
c, d) S
)
...+>
[akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
[akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
[akpm@linux-foundation.org: checkpatch fixes]
[akpm@linux-foundation.org: fix warnings]
[akpm@linux-foudnation.org: redo intrusive kvm changes]
Tested-by: Peter Senna Tschudin <peter.senna@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-27 17:06:00 -08:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2015-08-10 23:39:09 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
|
|
|
|
|
2015-08-10 23:39:09 +09:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-02 11:17:58 +09:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-06-17 12:09:58 -07:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-04 17:17:39 -07:00
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-06-17 12:09:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-18 14:27:01 -07:00
|
|
|
|
2013-06-17 12:09:58 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-02-07 03:17:31 +01:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2014-04-22 15:01:30 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 12:09:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2013-06-17 12:09:57 -07:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-06-17 12:09:58 -07:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-10 16:37:33 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-12-10 16:37:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
2013-12-10 16:37:33 +08:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-10 16:37:33 +08:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2013-12-10 16:37:33 +08:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-12-10 16:37:33 +08:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-10 16:37:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-08-19 11:23:07 -07:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
2013-06-17 14:16:10 -07:00
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2015-04-02 11:17:58 +09:00
|
|
|
|
2013-06-17 14:16:10 -07:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2013-06-17 14:16:10 -07:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2015-03-20 10:26:21 -03:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2013-07-18 08:40:15 -07:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2013-07-18 08:40:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2013-07-18 08:40:15 -07:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2015-03-20 10:26:21 -03:00
|
|
|
|
2013-07-18 08:40:15 -07:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
2015-02-10 16:30:32 -08:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-19 17:07:32 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-10 16:30:32 -08:00
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-04 22:51:07 -07:00
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-07 16:29:08 +01:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-04 22:51:07 -07:00
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-19 17:07:33 -07:00
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2013-08-19 11:23:02 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-01-08 12:31:18 -08:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-08-19 11:22:54 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-08-19 11:22:54 -07:00
|
|
|
|
2015-01-08 12:31:18 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:02 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-09-24 10:25:40 -07:00
|
|
|
|
2013-08-19 11:23:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
2015-02-10 16:30:32 -08:00
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-13 19:13:53 +03:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2015-08-26 23:46:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 12:49:32 +02:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 12:49:32 +02:00
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-13 19:13:53 +03:00
|
|
|
|
2015-01-08 12:31:18 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-02 11:17:58 +09:00
|
|
|
|
2015-01-08 12:31:18 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
2013-08-19 11:23:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-08 12:31:18 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:02 -07:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-18 12:32:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-22 21:34:16 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
vxlan: fix nonfunctional neigh_reduce()
The VXLAN neigh_reduce() code is completely non-functional since
check-in. Specific errors:
1) The original code drops all packets with a multicast destination address,
even though neighbor solicitations are sent to the solicited-node
address, a multicast address. The code after this check was never run.
2) The neighbor table lookup used the IPv6 header destination, which is the
solicited node address, rather than the target address from the
neighbor solicitation. So neighbor lookups would always fail if it
got this far. Also for L3MISSes.
3) The code calls ndisc_send_na(), which does a send on the tunnel device.
The context for neigh_reduce() is the transmit path, vxlan_xmit(),
where the host or a bridge-attached neighbor is trying to transmit
a neighbor solicitation. To respond to it, the tunnel endpoint needs
to do a *receive* of the appropriate neighbor advertisement. Doing a
send, would only try to send the advertisement, encapsulated, to the
remote destinations in the fdb -- hosts that definitely did not do the
corresponding solicitation.
4) The code uses the tunnel endpoint IPv6 forwarding flag to determine the
isrouter flag in the advertisement. This has nothing to do with whether
or not the target is a router, and generally won't be set since the
tunnel endpoint is bridging, not routing, traffic.
The patch below creates a proxy neighbor advertisement to respond to
neighbor solicitions as intended, providing proper IPv6 support for neighbor
reduction.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 10:39:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vxlan: fix nonfunctional neigh_reduce()
The VXLAN neigh_reduce() code is completely non-functional since
check-in. Specific errors:
1) The original code drops all packets with a multicast destination address,
even though neighbor solicitations are sent to the solicited-node
address, a multicast address. The code after this check was never run.
2) The neighbor table lookup used the IPv6 header destination, which is the
solicited node address, rather than the target address from the
neighbor solicitation. So neighbor lookups would always fail if it
got this far. Also for L3MISSes.
3) The code calls ndisc_send_na(), which does a send on the tunnel device.
The context for neigh_reduce() is the transmit path, vxlan_xmit(),
where the host or a bridge-attached neighbor is trying to transmit
a neighbor solicitation. To respond to it, the tunnel endpoint needs
to do a *receive* of the appropriate neighbor advertisement. Doing a
send, would only try to send the advertisement, encapsulated, to the
remote destinations in the fdb -- hosts that definitely did not do the
corresponding solicitation.
4) The code uses the tunnel endpoint IPv6 forwarding flag to determine the
isrouter flag in the advertisement. This has nothing to do with whether
or not the target is a router, and generally won't be set since the
tunnel endpoint is bridging, not routing, traffic.
The patch below creates a proxy neighbor advertisement to respond to
neighbor solicitions as intended, providing proper IPv6 support for neighbor
reduction.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 10:39:58 -04:00
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
|
|
|
|
|
vxlan: fix nonfunctional neigh_reduce()
The VXLAN neigh_reduce() code is completely non-functional since
check-in. Specific errors:
1) The original code drops all packets with a multicast destination address,
even though neighbor solicitations are sent to the solicited-node
address, a multicast address. The code after this check was never run.
2) The neighbor table lookup used the IPv6 header destination, which is the
solicited node address, rather than the target address from the
neighbor solicitation. So neighbor lookups would always fail if it
got this far. Also for L3MISSes.
3) The code calls ndisc_send_na(), which does a send on the tunnel device.
The context for neigh_reduce() is the transmit path, vxlan_xmit(),
where the host or a bridge-attached neighbor is trying to transmit
a neighbor solicitation. To respond to it, the tunnel endpoint needs
to do a *receive* of the appropriate neighbor advertisement. Doing a
send, would only try to send the advertisement, encapsulated, to the
remote destinations in the fdb -- hosts that definitely did not do the
corresponding solicitation.
4) The code uses the tunnel endpoint IPv6 forwarding flag to determine the
isrouter flag in the advertisement. This has nothing to do with whether
or not the target is a router, and generally won't be set since the
tunnel endpoint is bridging, not routing, traffic.
The patch below creates a proxy neighbor advertisement to respond to
neighbor solicitions as intended, providing proper IPv6 support for neighbor
reduction.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 10:39:58 -04:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vxlan: fix nonfunctional neigh_reduce()
The VXLAN neigh_reduce() code is completely non-functional since
check-in. Specific errors:
1) The original code drops all packets with a multicast destination address,
even though neighbor solicitations are sent to the solicited-node
address, a multicast address. The code after this check was never run.
2) The neighbor table lookup used the IPv6 header destination, which is the
solicited node address, rather than the target address from the
neighbor solicitation. So neighbor lookups would always fail if it
got this far. Also for L3MISSes.
3) The code calls ndisc_send_na(), which does a send on the tunnel device.
The context for neigh_reduce() is the transmit path, vxlan_xmit(),
where the host or a bridge-attached neighbor is trying to transmit
a neighbor solicitation. To respond to it, the tunnel endpoint needs
to do a *receive* of the appropriate neighbor advertisement. Doing a
send, would only try to send the advertisement, encapsulated, to the
remote destinations in the fdb -- hosts that definitely did not do the
corresponding solicitation.
4) The code uses the tunnel endpoint IPv6 forwarding flag to determine the
isrouter flag in the advertisement. This has nothing to do with whether
or not the target is a router, and generally won't be set since the
tunnel endpoint is bridging, not routing, traffic.
The patch below creates a proxy neighbor advertisement to respond to
neighbor solicitions as intended, providing proper IPv6 support for neighbor
reduction.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 10:39:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vxlan: fix nonfunctional neigh_reduce()
The VXLAN neigh_reduce() code is completely non-functional since
check-in. Specific errors:
1) The original code drops all packets with a multicast destination address,
even though neighbor solicitations are sent to the solicited-node
address, a multicast address. The code after this check was never run.
2) The neighbor table lookup used the IPv6 header destination, which is the
solicited node address, rather than the target address from the
neighbor solicitation. So neighbor lookups would always fail if it
got this far. Also for L3MISSes.
3) The code calls ndisc_send_na(), which does a send on the tunnel device.
The context for neigh_reduce() is the transmit path, vxlan_xmit(),
where the host or a bridge-attached neighbor is trying to transmit
a neighbor solicitation. To respond to it, the tunnel endpoint needs
to do a *receive* of the appropriate neighbor advertisement. Doing a
send, would only try to send the advertisement, encapsulated, to the
remote destinations in the fdb -- hosts that definitely did not do the
corresponding solicitation.
4) The code uses the tunnel endpoint IPv6 forwarding flag to determine the
isrouter flag in the advertisement. This has nothing to do with whether
or not the target is a router, and generally won't be set since the
tunnel endpoint is bridging, not routing, traffic.
The patch below creates a proxy neighbor advertisement to respond to
neighbor solicitions as intended, providing proper IPv6 support for neighbor
reduction.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 10:39:58 -04:00
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vxlan: fix nonfunctional neigh_reduce()
The VXLAN neigh_reduce() code is completely non-functional since
check-in. Specific errors:
1) The original code drops all packets with a multicast destination address,
even though neighbor solicitations are sent to the solicited-node
address, a multicast address. The code after this check was never run.
2) The neighbor table lookup used the IPv6 header destination, which is the
solicited node address, rather than the target address from the
neighbor solicitation. So neighbor lookups would always fail if it
got this far. Also for L3MISSes.
3) The code calls ndisc_send_na(), which does a send on the tunnel device.
The context for neigh_reduce() is the transmit path, vxlan_xmit(),
where the host or a bridge-attached neighbor is trying to transmit
a neighbor solicitation. To respond to it, the tunnel endpoint needs
to do a *receive* of the appropriate neighbor advertisement. Doing a
send, would only try to send the advertisement, encapsulated, to the
remote destinations in the fdb -- hosts that definitely did not do the
corresponding solicitation.
4) The code uses the tunnel endpoint IPv6 forwarding flag to determine the
isrouter flag in the advertisement. This has nothing to do with whether
or not the target is a router, and generally won't be set since the
tunnel endpoint is bridging, not routing, traffic.
The patch below creates a proxy neighbor advertisement to respond to
neighbor solicitions as intended, providing proper IPv6 support for neighbor
reduction.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 10:39:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
vxlan: fix nonfunctional neigh_reduce()
The VXLAN neigh_reduce() code is completely non-functional since
check-in. Specific errors:
1) The original code drops all packets with a multicast destination address,
even though neighbor solicitations are sent to the solicited-node
address, a multicast address. The code after this check was never run.
2) The neighbor table lookup used the IPv6 header destination, which is the
solicited node address, rather than the target address from the
neighbor solicitation. So neighbor lookups would always fail if it
got this far. Also for L3MISSes.
3) The code calls ndisc_send_na(), which does a send on the tunnel device.
The context for neigh_reduce() is the transmit path, vxlan_xmit(),
where the host or a bridge-attached neighbor is trying to transmit
a neighbor solicitation. To respond to it, the tunnel endpoint needs
to do a *receive* of the appropriate neighbor advertisement. Doing a
send, would only try to send the advertisement, encapsulated, to the
remote destinations in the fdb -- hosts that definitely did not do the
corresponding solicitation.
4) The code uses the tunnel endpoint IPv6 forwarding flag to determine the
isrouter flag in the advertisement. This has nothing to do with whether
or not the target is a router, and generally won't be set since the
tunnel endpoint is bridging, not routing, traffic.
The patch below creates a proxy neighbor advertisement to respond to
neighbor solicitions as intended, providing proper IPv6 support for neighbor
reduction.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 10:39:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
vxlan: fix nonfunctional neigh_reduce()
The VXLAN neigh_reduce() code is completely non-functional since
check-in. Specific errors:
1) The original code drops all packets with a multicast destination address,
even though neighbor solicitations are sent to the solicited-node
address, a multicast address. The code after this check was never run.
2) The neighbor table lookup used the IPv6 header destination, which is the
solicited node address, rather than the target address from the
neighbor solicitation. So neighbor lookups would always fail if it
got this far. Also for L3MISSes.
3) The code calls ndisc_send_na(), which does a send on the tunnel device.
The context for neigh_reduce() is the transmit path, vxlan_xmit(),
where the host or a bridge-attached neighbor is trying to transmit
a neighbor solicitation. To respond to it, the tunnel endpoint needs
to do a *receive* of the appropriate neighbor advertisement. Doing a
send, would only try to send the advertisement, encapsulated, to the
remote destinations in the fdb -- hosts that definitely did not do the
corresponding solicitation.
4) The code uses the tunnel endpoint IPv6 forwarding flag to determine the
isrouter flag in the advertisement. This has nothing to do with whether
or not the target is a router, and generally won't be set since the
tunnel endpoint is bridging, not routing, traffic.
The patch below creates a proxy neighbor advertisement to respond to
neighbor solicitions as intended, providing proper IPv6 support for neighbor
reduction.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 10:39:58 -04:00
|
|
|
|
|
|
|
|
|
2014-08-22 21:34:16 +02:00
|
|
|
|
vxlan: fix nonfunctional neigh_reduce()
The VXLAN neigh_reduce() code is completely non-functional since
check-in. Specific errors:
1) The original code drops all packets with a multicast destination address,
even though neighbor solicitations are sent to the solicited-node
address, a multicast address. The code after this check was never run.
2) The neighbor table lookup used the IPv6 header destination, which is the
solicited node address, rather than the target address from the
neighbor solicitation. So neighbor lookups would always fail if it
got this far. Also for L3MISSes.
3) The code calls ndisc_send_na(), which does a send on the tunnel device.
The context for neigh_reduce() is the transmit path, vxlan_xmit(),
where the host or a bridge-attached neighbor is trying to transmit
a neighbor solicitation. To respond to it, the tunnel endpoint needs
to do a *receive* of the appropriate neighbor advertisement. Doing a
send, would only try to send the advertisement, encapsulated, to the
remote destinations in the fdb -- hosts that definitely did not do the
corresponding solicitation.
4) The code uses the tunnel endpoint IPv6 forwarding flag to determine the
isrouter flag in the advertisement. This has nothing to do with whether
or not the target is a router, and generally won't be set since the
tunnel endpoint is bridging, not routing, traffic.
The patch below creates a proxy neighbor advertisement to respond to
neighbor solicitions as intended, providing proper IPv6 support for neighbor
reduction.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 10:39:58 -04:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-22 21:34:16 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
2013-08-31 13:44:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-22 21:34:16 +02:00
|
|
|
|
2013-08-31 13:44:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drivers/net: Convert uses of compare_ether_addr to ether_addr_equal
Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.
Done via cocci script: (and a little typing)
$ cat compare_ether_addr.cocci
@@
expression a,b;
@@
- !compare_ether_addr(a, b)
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- compare_ether_addr(a, b)
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- !ether_addr_equal(a, b) == 0
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- !ether_addr_equal(a, b) != 0
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- ether_addr_equal(a, b) == 0
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- ether_addr_equal(a, b) != 0
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- !!ether_addr_equal(a, b)
+ ether_addr_equal(a, b)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-01 11:51:23 -07:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-04 17:00:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-04-05 22:19:09 -04:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2015-07-22 17:08:42 +02:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-24 10:02:49 +02:00
|
|
|
|
2013-09-02 15:34:57 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2015-01-13 17:13:44 +01:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-23 16:20:36 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2014-11-19 14:04:59 +01:00
|
|
|
|
2014-12-23 16:20:36 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-04-09 11:19:14 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-01-08 12:31:18 -08:00
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
|
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
2014-09-29 20:22:33 -07:00
|
|
|
|
|
|
|
|
|
2015-04-05 22:19:09 -04:00
|
|
|
|
2015-01-20 11:23:04 -08:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2014-12-23 16:20:36 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
|
|
|
|
|
2015-07-22 17:08:42 +02:00
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
2013-08-19 11:23:17 -07:00
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:22 -07:00
|
|
|
|
2013-08-19 11:23:17 -07:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:17 -07:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:22 -07:00
|
|
|
|
2013-08-19 11:23:29 -07:00
|
|
|
|
2015-01-13 17:13:44 +01:00
|
|
|
|
2013-08-19 11:23:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-23 16:20:36 -08:00
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:22 -07:00
|
|
|
|
2014-12-23 16:20:36 -08:00
|
|
|
|
2013-08-19 11:23:22 -07:00
|
|
|
|
2014-11-19 14:04:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:29 -07:00
|
|
|
|
2015-04-09 11:19:14 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:17 -07:00
|
|
|
|
2015-01-08 12:31:18 -08:00
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
2013-08-19 11:23:17 -07:00
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
|
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
2014-09-29 20:22:33 -07:00
|
|
|
|
|
|
|
|
|
2015-04-05 22:19:09 -04:00
|
|
|
|
2015-01-20 11:23:04 -08:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2013-08-19 11:23:17 -07:00
|
|
|
|
|
|
|
|
|
2015-12-07 13:04:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-04 13:57:59 +08:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2014-10-16 08:49:41 +08:00
|
|
|
|
|
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
2014-01-04 13:57:59 +08:00
|
|
|
|
|
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-16 08:49:41 +08:00
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-16 08:49:41 +08:00
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
|
|
|
|
|
2014-10-16 08:49:41 +08:00
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-07-21 10:44:00 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-06-17 14:16:41 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-06-17 17:49:56 -07:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-08-20 13:56:25 +02:00
|
|
|
|
2015-07-21 10:44:00 +02:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
2015-08-20 13:56:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
2012-10-09 20:35:46 +00:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
2012-10-09 20:35:46 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-03-25 14:49:53 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-08-20 13:56:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-30 18:09:38 -07:00
|
|
|
|
2015-08-20 13:56:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-20 13:56:30 +02:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-05-05 15:09:21 +02:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2012-10-09 20:35:48 +00:00
|
|
|
|
2014-04-24 10:02:49 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-09 10:33:53 +08:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-13 14:43:08 -02:00
|
|
|
|
2015-01-15 03:53:56 +01:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-05 22:19:09 -04:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2014-12-23 16:20:36 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2014-12-23 16:20:36 -08:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-07 13:04:30 +01:00
|
|
|
|
2015-08-20 13:56:29 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-07 13:04:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-20 13:56:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-13 14:43:08 -02:00
|
|
|
|
2015-01-15 03:53:56 +01:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-07 13:04:30 +01:00
|
|
|
|
2015-07-21 10:44:06 +02:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2015-08-20 13:56:30 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-04-02 12:31:52 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:23:17 -07:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:00 +02:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
2014-01-06 09:54:31 -08:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
2015-08-20 13:56:25 +02:00
|
|
|
|
2015-07-21 10:44:00 +02:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-16 09:17:18 +08:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-17 14:06:16 +08:00
|
|
|
|
2013-08-31 13:44:36 +08:00
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2015-08-04 22:51:07 -07:00
|
|
|
|
2015-08-28 20:48:19 +02:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2013-04-19 00:36:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:34 +08:00
|
|
|
|
|
|
|
|
|
2013-04-19 00:36:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
2014-01-06 09:54:31 -08:00
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
2013-06-17 14:16:12 -07:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-06 09:54:31 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-06 09:54:31 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
2013-03-15 04:35:51 +00:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-26 10:42:04 +03:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-26 06:24:34 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-26 10:42:04 +03:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-13 11:46:28 -08:00
|
|
|
|
2013-03-25 14:49:46 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 17:06:01 -07:00
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 17:06:01 -07:00
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-12-10 16:37:32 +08:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2015-08-25 20:22:35 -03:00
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-27 22:35:52 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-24 10:02:49 +02:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-03-23 16:23:12 -03:00
|
|
|
|
2015-04-08 14:48:30 -07:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-18 00:21:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-24 10:02:49 +02:00
|
|
|
|
2013-12-18 00:21:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-22 18:17:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-07 13:04:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-22 18:17:16 -07:00
|
|
|
|
2015-12-07 13:04:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-22 18:17:16 -07:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:46 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-12-18 00:21:08 +01:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-22 18:17:16 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
2013-09-13 07:34:13 -07:00
|
|
|
|
|
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-13 07:34:13 -07:00
|
|
|
|
|
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-13 07:34:13 -07:00
|
|
|
|
|
|
|
|
|
2015-08-20 13:56:28 +02:00
|
|
|
|
2013-09-04 02:13:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-27 22:35:52 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-07 14:14:16 +00:00
|
|
|
|
2012-12-07 14:14:18 +00:00
|
|
|
|
2013-03-07 13:22:36 +00:00
|
|
|
|
2012-12-07 14:14:18 +00:00
|
|
|
|
2013-08-19 11:23:29 -07:00
|
|
|
|
|
|
|
|
|
2012-12-07 14:14:18 +00:00
|
|
|
|
2013-03-07 13:22:36 +00:00
|
|
|
|
2013-08-19 11:23:29 -07:00
|
|
|
|
2014-10-05 18:38:35 -07:00
|
|
|
|
2015-08-18 10:30:35 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2012-10-09 20:35:50 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2015-08-19 17:07:33 -07:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-27 11:31:55 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-09 20:35:50 +00:00
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-30 20:10:22 -07:00
|
|
|
|
2013-04-27 11:31:57 +00:00
|
|
|
|
2014-11-06 18:06:01 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
2015-02-10 16:30:32 -08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-09 20:35:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-29 23:43:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-16 17:31:18 -07:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-13 19:49:42 -07:00
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2014-07-13 19:49:42 -07:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2014-07-13 19:49:42 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-24 20:08:38 -08:00
|
|
|
|
2015-08-28 20:48:22 +02:00
|
|
|
|
2014-07-13 19:49:42 -07:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2014-07-13 19:49:42 -07:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2014-07-13 19:49:42 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-10-28 14:01:48 +08:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-27 22:35:52 +00:00
|
|
|
|
2014-09-16 17:31:18 -07:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-13 19:49:42 -07:00
|
|
|
|
2013-10-28 14:01:48 +08:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2013-11-01 13:09:43 +08:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
2015-01-20 11:23:05 -08:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
|
|
|
|
|
2014-01-20 13:59:21 +02:00
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
2014-09-16 17:31:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
|
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
2015-03-18 14:50:44 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:01 +02:00
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-01-26 22:28:14 +01:00
|
|
|
|
2016-01-07 11:26:53 +01:00
|
|
|
|
2013-04-16 02:50:52 +00:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-01-26 22:28:14 +01:00
|
|
|
|
2014-04-24 10:02:49 +02:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2014-04-01 09:23:01 +03:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2015-09-17 16:11:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2015-09-17 16:11:11 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2012-10-09 20:35:53 +00:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2012-10-09 20:35:53 +00:00
|
|
|
|
2013-04-16 02:50:52 +00:00
|
|
|
|
2012-10-09 20:35:53 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2012-10-09 20:35:53 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-11-13 13:10:59 +00:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
2015-09-17 16:11:10 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-09-24 13:50:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
2012-10-30 10:27:16 +00:00
|
|
|
|
2016-01-07 11:26:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2016-01-07 11:26:53 +01:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2014-05-11 00:12:32 +00:00
|
|
|
|
2013-01-29 23:43:07 +00:00
|
|
|
|
2013-09-17 12:12:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2013-09-17 12:12:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
|
|
|
|
|
2013-06-25 17:06:01 -07:00
|
|
|
|
2013-06-25 16:01:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-16 16:36:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-30 20:10:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-24 10:02:49 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-07-13 10:18:18 -07:00
|
|
|
|
2013-08-19 11:22:48 -07:00
|
|
|
|
|
|
|
|
|
2013-07-13 10:18:18 -07:00
|
|
|
|
|
|
|
|
|
2015-08-19 17:07:33 -07:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-04 22:51:07 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2012-10-09 20:35:50 +00:00
|
|
|
|
2014-06-04 17:20:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-16 02:50:52 +00:00
|
|
|
|
2012-10-09 20:35:50 +00:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
2012-10-09 20:35:50 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-04-16 02:50:52 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
2015-03-29 16:59:25 +02:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:59:25 +02:00
|
|
|
|
|
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-04-16 02:50:52 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
2015-03-29 16:59:25 +02:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-29 16:59:25 +02:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
2013-08-31 13:44:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
2012-11-20 02:50:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-04 22:51:07 -07:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 17:20:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 17:00:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2012-10-09 20:35:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.
The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.
SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels. However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.
Host 1: Host 2:
Group A Group B Group B Group A
+-----+ +-------------+ +-------+ +-----+
| lxc | | SELinux CTX | | httpd | | VM |
+--+--+ +--+----------+ +---+---+ +--+--+
\---+---/ \----+---/
| |
+---+---+ +---+---+
| vxlan | | vxlan |
+---+---+ +---+---+
+------------------------------+
Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP frames. The extension is therefore disabled by default
and needs to be specifically enabled:
ip link add [...] type vxlan [...] gbp
In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.
Examples:
iptables:
host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
host2# iptables -I INPUT -m mark --mark 0x200 -j DROP
OVS:
# ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
# ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'
[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 03:53:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-10 16:30:32 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-15 15:11:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-15 15:11:17 +01:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2014-01-13 18:41:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
net: vxlan: convert to act as a pernet subsystem
As per suggestion from Eric W. Biederman, vxlan should be using
{un,}register_pernet_subsys() instead of {un,}register_pernet_device()
to ensure the vxlan_net structure is initialized before and cleaned
up after all network devices in a given network namespace i.e. when
dealing with network notifiers. This is similarly handeled already in
commit 91e2ff3528ac ("net: Teach vlans to cleanup as a pernet subsystem")
and, thus, improves upon fd27e0d44a89 ("net: vxlan: do not use vxlan_net
before checking event type"). Just as in 91e2ff3528ac, we do not need
to explicitly handle deletion of vxlan devices as network namespace
exit calls dellink on all remaining virtual devices, and
rtnl_link_unregister() calls dellink on all outstanding devices in that
network namespace, so we can entirely drop the pernet exit operation
as well. Moreover, on vxlan module exit, rcu_barrier() is called by
netns since commit 3a765edadb28 ("netns: Add an explicit rcu_barrier
to unregister_pernet_{device|subsys}"), so this may be omitted. Tested
with various scenarios and works well on my side.
Suggested-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-22 21:07:53 +01:00
|
|
|
|
2014-01-13 18:41:19 +01:00
|
|
|
|
net: vxlan: convert to act as a pernet subsystem
As per suggestion from Eric W. Biederman, vxlan should be using
{un,}register_pernet_subsys() instead of {un,}register_pernet_device()
to ensure the vxlan_net structure is initialized before and cleaned
up after all network devices in a given network namespace i.e. when
dealing with network notifiers. This is similarly handeled already in
commit 91e2ff3528ac ("net: Teach vlans to cleanup as a pernet subsystem")
and, thus, improves upon fd27e0d44a89 ("net: vxlan: do not use vxlan_net
before checking event type"). Just as in 91e2ff3528ac, we do not need
to explicitly handle deletion of vxlan devices as network namespace
exit calls dellink on all remaining virtual devices, and
rtnl_link_unregister() calls dellink on all outstanding devices in that
network namespace, so we can entirely drop the pernet exit operation
as well. Moreover, on vxlan module exit, rcu_barrier() is called by
netns since commit 3a765edadb28 ("netns: Add an explicit rcu_barrier
to unregister_pernet_{device|subsys}"), so this may be omitted. Tested
with various scenarios and works well on my side.
Suggested-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-22 21:07:53 +01:00
|
|
|
|
2014-01-13 18:41:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-27 22:35:52 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
2013-06-17 14:16:11 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-05-16 11:35:20 +00:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-24 10:02:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-19 17:07:33 -07:00
|
|
|
|
|
|
|
|
|
2015-05-18 13:51:24 -04:00
|
|
|
|
2015-08-19 17:07:33 -07:00
|
|
|
|
2014-04-24 10:02:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2014-04-24 10:02:49 +02:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
net: vxlan: convert to act as a pernet subsystem
As per suggestion from Eric W. Biederman, vxlan should be using
{un,}register_pernet_subsys() instead of {un,}register_pernet_device()
to ensure the vxlan_net structure is initialized before and cleaned
up after all network devices in a given network namespace i.e. when
dealing with network notifiers. This is similarly handeled already in
commit 91e2ff3528ac ("net: Teach vlans to cleanup as a pernet subsystem")
and, thus, improves upon fd27e0d44a89 ("net: vxlan: do not use vxlan_net
before checking event type"). Just as in 91e2ff3528ac, we do not need
to explicitly handle deletion of vxlan devices as network namespace
exit calls dellink on all remaining virtual devices, and
rtnl_link_unregister() calls dellink on all outstanding devices in that
network namespace, so we can entirely drop the pernet exit operation
as well. Moreover, on vxlan module exit, rcu_barrier() is called by
netns since commit 3a765edadb28 ("netns: Add an explicit rcu_barrier
to unregister_pernet_{device|subsys}"), so this may be omitted. Tested
with various scenarios and works well on my side.
Suggested-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-22 21:07:53 +01:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-13 18:41:19 +01:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-13 18:41:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2014-01-13 18:41:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
net: vxlan: convert to act as a pernet subsystem
As per suggestion from Eric W. Biederman, vxlan should be using
{un,}register_pernet_subsys() instead of {un,}register_pernet_device()
to ensure the vxlan_net structure is initialized before and cleaned
up after all network devices in a given network namespace i.e. when
dealing with network notifiers. This is similarly handeled already in
commit 91e2ff3528ac ("net: Teach vlans to cleanup as a pernet subsystem")
and, thus, improves upon fd27e0d44a89 ("net: vxlan: do not use vxlan_net
before checking event type"). Just as in 91e2ff3528ac, we do not need
to explicitly handle deletion of vxlan devices as network namespace
exit calls dellink on all remaining virtual devices, and
rtnl_link_unregister() calls dellink on all outstanding devices in that
network namespace, so we can entirely drop the pernet exit operation
as well. Moreover, on vxlan module exit, rcu_barrier() is called by
netns since commit 3a765edadb28 ("netns: Add an explicit rcu_barrier
to unregister_pernet_{device|subsys}"), so this may be omitted. Tested
with various scenarios and works well on my side.
Suggested-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-22 21:07:53 +01:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
2013-06-17 14:16:09 -07:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
2013-05-27 22:35:53 +00:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 14:16:09 -07:00
|
|
|
|
2014-01-13 18:41:19 +01:00
|
|
|
|
2013-06-17 14:16:09 -07:00
|
|
|
|
net: vxlan: convert to act as a pernet subsystem
As per suggestion from Eric W. Biederman, vxlan should be using
{un,}register_pernet_subsys() instead of {un,}register_pernet_device()
to ensure the vxlan_net structure is initialized before and cleaned
up after all network devices in a given network namespace i.e. when
dealing with network notifiers. This is similarly handeled already in
commit 91e2ff3528ac ("net: Teach vlans to cleanup as a pernet subsystem")
and, thus, improves upon fd27e0d44a89 ("net: vxlan: do not use vxlan_net
before checking event type"). Just as in 91e2ff3528ac, we do not need
to explicitly handle deletion of vxlan devices as network namespace
exit calls dellink on all remaining virtual devices, and
rtnl_link_unregister() calls dellink on all outstanding devices in that
network namespace, so we can entirely drop the pernet exit operation
as well. Moreover, on vxlan module exit, rcu_barrier() is called by
netns since commit 3a765edadb28 ("netns: Add an explicit rcu_barrier
to unregister_pernet_{device|subsys}"), so this may be omitted. Tested
with various scenarios and works well on my side.
Suggested-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-22 21:07:53 +01:00
|
|
|
|
|
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-27 11:31:52 +00:00
|
|
|
|
2014-01-17 11:00:33 -08:00
|
|
|
|
2012-10-01 12:32:35 +00:00
|
|
|
|