lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 18 Dec 2013 17:12:13 +0800
From:	Libo Chen <clbchenlibo.chen@...wei.com>
To:	David Miller <davem@...emloft.net>, <kaber@...sh.net>,
	<xemul@...nvz.org>, Serge Hallyn <serge.hallyn@...onical.com>,
	<ebiederm@...ssion.com>, <herbert@...dor.apana.org.au>
CC:	<edumazet@...gle.com>, <fbl@...hat.com>, <ebiederm@...ssion.com>,
	<jeff@...zik.org>, <peterz@...radead.org>, <honkiko@...il.com>,
	<netdev@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
	Li Zefan <lizefan@...wei.com>,
	"zhangwei(Jovi)" <jovi.zhangwei@...wei.com>,
	"Huang Qiang" <h.huangqiang@...wei.com>,
	Wengmeiling <wengmeiling.weng@...wei.com>,
	<containers@...ts.linux-foundation.org>, <cgroups@...r.kernel.org>,
	<daniel.wagner@...-carit.de>, <nhorman@...driver.com>
Subject: Re: cgroup filter on physics interface can't control container

hello guys,

I said before "we can save sk_classid before skb_scrub_packet and
restore it after that"  since skb->sk had been freed in
skb_scrub_packet(), so it is not reasonable. yes?

I have another idea.
commit:f84517253(cls_cgroup: Store classid in struct sock) introduces
sk_classid and put it in skb->sk pointer.  can we put sk_classid form
struct sock to struct sk_buff? then sk_classid will not be affected
by dev_forward_skb()->skb_scrub_packet() ?

any comment are welcome!


thanks,
Libo


On 2013/12/12 20:18, Libo Chen wrote:
> ping...
> 
> On 2013/12/9 10:32, Libo Chen wrote:
>> hello network hackers,
>>
>> 	A linux container was builded with veth pair(veth0 inside container, veth1 outside container),
>>
>> the config as below:
>>
>>   lxc.network.type = veth
>>   lxc.network.flags = up
>>   lxc.network.link = br0  // base on eth0
>>   lxc.network.name = eth0
>>   lxc.network.ipv4 = 128.5.130.26/24
>>
>> then I use tc command with cgroup filter on veth0, it works well. But when setting on eth0, it doesn`t work.
>>
>> The reason is dev_forward_skb() in veth_xmit will call skb_scrub_packet and clean all information including skb->sk
>> in the skb, so if cls_cgroup_classify is working in serving softirq state, it will return failer, see below:
>>
>> 	if (in_serving_softirq()) {
>> 		/* If there is an sk_classid we'll use that. */
>> 		if (!skb->sk)
>> 			return -1;
>> 		classid = skb->sk->sk_classid;
>> 	}
>>
>>
>> Qdisc with cgroup filter on physics interface can not control a container network, it is disappointed.
>>
>> we can save sk_classid before skb_scrub_packet and restore it after that. Is it reasonable?  or any way to achieve this?
>>
>> thanks,
>> Libo
>>
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ